<commit_before>++ Introduction
++ SELECT queries
++ UPDATE queries
++ DELETE queries
++ FROM clause
++ JOIN syntax
++ INDEXBY keyword
++ WHERE clause
++ Conditional expressions
++ Functional Expressions
++ Subqueries
++ GROUP BY, HAVING clauses
++ ORDER BY clause
++ LIMIT and OFFSET clauses
++ Examples
++ The Query Registry
Doctrine_Query_Registry is a class for registering and naming queries. It helps with the organization of your applications queries and along with that it offers some very nice convenience stuff.

The queries are added using the add() method of the registry object. It takes two parameters, the query name and the actual DQL query.

<code type="php">
$r = Doctrine_Manager::getInstance()->getQueryRegistry();

$r->add('all-users', 'FROM User u');
</code>

+++ Namespaces

The Query registry supports namespaces. The namespace is separated from the actual name with / -mark. If the name of the namespace is a record name the given record has all the named queries availible in its local scope.

<code type="php">
$r = Doctrine_Manager::getInstance()->getQueryRegistry();

$r->add('User/all', 'FROM User u');
$r->add('User/byName', 'FROM User u WHERE u.name = ?');

$user = new User();

// find the user named <NAME>
$user = $user->findOne('byName', array('<NAME>'));<commit_msg>fixed typo<commit_after>++ Introduction
++ SELECT queries
++ UPDATE queries
++ DELETE queries
++ FROM clause
++ JOIN syntax
++ INDEXBY keyword
++ WHERE clause
++ Conditional expressions
++ Functional Expressions
++ Subqueries
++ GROUP BY, HAVING clauses
++ ORDER BY clause
++ LIMIT and OFFSET clauses
++ Examples
++ The Query Registry
Doctrine_Query_Registry is a class for registering and naming queries. It helps with the organization of your applications queries and along with that it offers some very nice convenience stuff.

The queries are added using the add() method of the registry object. It takes two parameters, the query name and the actual DQL query.

<code type="php">
$r = Doctrine_Manager::getInstance()->getQueryRegistry();

$r->add('all-users', 'FROM User u');
</code>

+++ Namespaces

The Query registry supports namespaces. The namespace is separated from the actual name with / -mark. If the name of the namespace is a record name the given record has all the named queries available in its local scope.

<code type="php">
$r = Doctrine_Manager::getInstance()->getQueryRegistry();

$r->add('User/all', 'FROM User u');
$r->add('User/byName', 'FROM User u WHERE u.name = ?');

$user = new User();

// find the user named <NAME>
$user = $user->findOne('byName', array('<NAME>'));
{'fraction_non_alphanumeric': 0.11610918877354863, 'fraction_numerical': 0.0, 'mean_word_length': 4.9953917050691246, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3132594', 'n_tokens_mistral': 721, 'n_tokens_neox': 695, 'n_words': 324}