X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FRepository%2FTagRepository.php;h=abf915fe5c7f23629af5b746530dc6d6c868d792;hb=97c8eb3c2398d0aaf06155de5e0828e4020cb5d4;hp=afeb985b30c272c9b9f76d84540b15eaf230f172;hpb=9b5edf33a00490b033692efca9987a35225835ba;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index afeb985b..abf915fe 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php @@ -3,41 +3,9 @@ namespace Wallabag\CoreBundle\Repository; use Doctrine\ORM\EntityRepository; -use Pagerfanta\Adapter\DoctrineORMAdapter; -use Pagerfanta\Pagerfanta; class TagRepository extends EntityRepository { - /** - * Return only the QueryBuilder to retrieve all tags for a given user. - * - * @param int $userId - * - * @return QueryBuilder - */ - private function getQbForAllTags($userId) - { - return $this->createQueryBuilder('t') - ->leftJoin('t.entries', 'e') - ->where('e.user = :userId')->setParameter('userId', $userId); - } - - /** - * Find Tags and return a Pager. - * - * @param int $userId - * - * @return Pagerfanta - */ - public function findTags($userId) - { - $qb = $this->getQbForAllTags($userId); - - $pagerAdapter = new DoctrineORMAdapter($qb); - - return new Pagerfanta($pagerAdapter); - } - /** * Find Tags. * @@ -47,7 +15,9 @@ class TagRepository extends EntityRepository */ public function findAllTags($userId) { - return $this->getQbForAllTags($userId) + return $this->createQueryBuilder('t') + ->leftJoin('t.entries', 'e') + ->where('e.user = :userId')->setParameter('userId', $userId) ->getQuery() ->getResult(); }