Como eu faria o MySQL count (*) no Doctrine2?
Eu tenho a seguinte consulta Doctrine2:
$qb = $em->createQueryBuilder()
->select('t.tag_text, COUNT(*) as num_tags')
->from('CompanyWebsiteBundle:Tag2Post', 't2p')
->innerJoin('t2p.tags', 't')
->groupBy('t.tag_text')
;
$tags = $qb->getQuery()->getResult();
Quando executado recebo o seguinte erro:
[Semantical Error] line 0, col 21 near '*) as num_tags': Error: '*' is not defined.
Como eu faria o MySQL count (*) no Doctrine2?