]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/TagRepository.php
Merge pull request #2306 from wallabag/redis-rabbit-check
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / TagRepository.php
index afeb985b30c272c9b9f76d84540b15eaf230f172..41f616079dd53f69032512adf6a1bfb176b98657 100644 (file)
@@ -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,9 +15,9 @@ class TagRepository extends EntityRepository
      */
     public function findAllTags($userId)
     {
-        return $this->getQbForAllTags($userId)
-            ->getQuery()
-            ->getResult();
+        return $this->createQueryBuilder('t')
+            ->leftJoin('t.entries', 'e')
+            ->where('e.user = :userId')->setParameter('userId', $userId);
     }
 
     /**