- $qb = $this->getQbForAllTags($userId);
-
- $pagerAdapter = new DoctrineORMAdapter($qb);
-
- return new Pagerfanta($pagerAdapter);
+ return $this->createQueryBuilder('t')
+ ->select('t.slug', 't.label', 't.id')
+ ->leftJoin('t.entries', 'e')
+ ->where('e.user = :userId')->setParameter('userId', $userId)
+ ->groupBy('t.slug')
+ ->addGroupBy('t.label')
+ ->addGroupBy('t.id')
+ ->getQuery()
+ ->getArrayResult();