X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FRepository%2FTagRepository.php;h=9c4096072626273dd98372a69f95f85a07c61262;hb=8ce32af61229eec8f4cc34b207273d47f60adc48;hp=52f319f11158f69315b30650d5ba9ce0782f8fc8;hpb=0ca374e6a1698926b08635d6a276ff3bf91c76a5;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index 52f319f1..9c409607 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php @@ -3,7 +3,25 @@ namespace Wallabag\CoreBundle\Repository; use Doctrine\ORM\EntityRepository; +use Pagerfanta\Adapter\DoctrineORMAdapter; +use Pagerfanta\Pagerfanta; class TagRepository extends EntityRepository { + /** + * Find Tags. + * + * @param int $userId + * + * @return array + */ + public function findTags($userId) + { + $qb = $this->createQueryBuilder('t') + ->where('t.user =:userId')->setParameter('userId', $userId); + + $pagerAdapter = new DoctrineORMAdapter($qb); + + return new Pagerfanta($pagerAdapter); + } }