]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Return pager into EntryRepository (for entries only)
authorWilliam Durand <will+git@drnd.me>
Fri, 6 Mar 2015 10:07:22 +0000 (11:07 +0100)
committerNicolas LÅ“uillet <nicolas@loeuillet.org>
Fri, 6 Mar 2015 20:11:01 +0000 (21:11 +0100)
src/Wallabag/CoreBundle/Repository/EntryRepository.php

index 04fe6aa345137f78a0ef7934ae90782550c955a9..53e8e2ba1e1c717992a632f3f3b3973938f5f7d2 100644 (file)
@@ -4,6 +4,8 @@ namespace Wallabag\CoreBundle\Repository;
 
 use Doctrine\ORM\EntityRepository;
 use Doctrine\ORM\Tools\Pagination\Paginator;
+use Pagerfanta\Adapter\DoctrineORMAdapter;
+use Pagerfanta\Pagerfanta;
 
 class EntryRepository extends EntityRepository
 {
@@ -114,9 +116,9 @@ class EntryRepository extends EntityRepository
             $qb->orderBy('e.updatedAt', $order);
         }
 
-        return $qb
-            ->getQuery()
-            ->getResult();
+        $pagerAdapter = new DoctrineORMAdapter($qb);
+
+        return new Pagerfanta($pagerAdapter);
     }
 
     /**