1
0
mirror of synced 2024-12-14 07:06:04 +03:00
doctrine2/manual/docs/Working with objects - Component overview - Query - HAVING conditions.php
legenerationlazi 13840516a9 removed empty php tags at the top of some pages
html->wiki conversion previously missed
2007-04-19 20:41:19 +00:00

18 lines
497 B
PHP

Doctrine_Query provides having() method for adding HAVING conditions to the DQL query. This method is identical in function to the Doctrine_Query::where() method.
If you call having() multiple times, the conditions are ANDed together; if you want to OR a condition, use orHaving().
<code type="php">
\$q = new Doctrine_Query();
\$users = \$q->select('u.name')
->from('User u')
->leftJoin('u.Phonenumber p');
->having('COUNT(p.id) > 3');
?></code>