Add tags list display

This commit is contained in:
Nicolas Lœuillet
2015-08-07 18:17:23 +02:00
parent 6ecdd48a3f
commit 3f3fbef11f
5 changed files with 80 additions and 2 deletions

View File

@ -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);
}
}