Return pager into EntryRepository (for entries only)

This commit is contained in:
William Durand 2015-03-06 11:07:22 +01:00 committed by Nicolas Lœuillet
parent a24f2c8808
commit bcf53ab75b

View 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);
}
/**