X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FRepository%2FTagRepository.php;h=e76878d49d6e7cc5bb06c0f2a1d8227ef2bec4bc;hb=5601b4536cea2a4c5ebdd39251cc16ec92c01b1d;hp=9d127da7143b588e4b600088502ffd61c7dd654d;hpb=7e98ad962680fac17b3b90ae34b9c6e5afe7636f;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index 9d127da7..e76878d4 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php @@ -33,19 +33,23 @@ class TagRepository extends EntityRepository } /** - * Find all tags with associated entries per user. + * Find all tags per user. * * @param int $userId * * @return array */ - public function findAllTagsWithEntries($userId) + public function findAllTags($userId) { 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() - ->getResult(); + ->getArrayResult(); } /**