Hi guys,
I've got the following query uisng the createQueryBuilder
$this->createQueryBuilder('ea')
->select('distinct ea.getme')
->where('ea.criteria1 = :criteria1')
->andWhere('ea.criteria2 = :criteria2')
->setParameter('criteria1', 'somethine')
->setParameter('criteria2', 'a value')
->groupBy('ea.getme')
->getQuery()
->getArrayResult();
this currently returns an array that looks something like this
array(
0 => array( 1 => 4),
1 => array( 1 => 5)
)
So far it just returns the distinct ids, this is ok. But what i would like
to do is also return the count of number of items for that unique field. i
dont know how to add it. but the end result i want to see is something like:
array(
0 => array(4 => 14),
1 => array(5 => 6)
)
where 6 and 14 are the counts.
additionally, how can i get the result to be
array(
4 => 14,
5 => 6
)
thanks in advance for any and all help
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.