From: William Durand Date: Fri, 6 Mar 2015 10:07:22 +0000 (+0100) Subject: Return pager into EntryRepository (for entries only) X-Git-Tag: 2.0.0-alpha.0~73^2~1 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;ds=inline;h=bcf53ab75b2fbd0cc18faf2db61c81fa3d7c471d;p=github%2Fwallabag%2Fwallabag.git Return pager into EntryRepository (for entries only) --- diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 04fe6aa3..53e8e2ba 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -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); } /**