Closed GoogleCodeExporter closed 9 years ago
I can't see a problem here.
Have you tried the SIZE function
(http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-la
nguage.html#dql-functions)?
Following example works:
$qb = $em->getRepository('\My\Entity\Account')->createQueryBuilder('c');
$qb->select('c.name', 'SIZE(c.bugsToReview)');
You can find this example in the Doctrine2Controller#accountAction in the
current trunk.
Original comment by martin.p...@gmail.com
on 19 Oct 2011 at 2:21
Original comment by martin.p...@gmail.com
on 19 Oct 2011 at 2:21
confiremed: this works
//NOT WORK: $selectColumnsDBLArr[] = 'count(p.prota_changelogs)'; # Message:
[Semantical Error] line 0, col 149 near 'prota_changelogs)': Error: Invalid
PathExpression. StateFieldPathExpression or SingleValuedAssociationField
expected.
//DOES WORK: $selectColumnsDBLArr[] = 'size(p.prota_changelogs)';
thanks, you can close this
Original comment by phpact...@gmail.com
on 20 Oct 2011 at 3:06
Original comment by martin.p...@gmail.com
on 21 Oct 2011 at 10:11
Original issue reported on code.google.com by
phpact...@gmail.com
on 4 Oct 2011 at 8:09