diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2015-08-09 22:47:28 +0200 |
---|---|---|
committer | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2015-08-09 22:47:28 +0200 |
commit | 47cadf36c8f7c20ba1edf26e184637d33a52cf35 (patch) | |
tree | b25f67a8d32c3d211e6d16dfe010805c3bdafc0e /src/Wallabag/CoreBundle/Repository/TagRepository.php | |
parent | 20a69dffe7e1caf01c12b2c39dbb2f9cb8093925 (diff) | |
parent | d0b90fbe18da72dc09a0ef748fa178314f6657b6 (diff) | |
download | wallabag-47cadf36c8f7c20ba1edf26e184637d33a52cf35.tar.gz wallabag-47cadf36c8f7c20ba1edf26e184637d33a52cf35.tar.zst wallabag-47cadf36c8f7c20ba1edf26e184637d33a52cf35.zip |
Merge pull request #1292 from wallabag/v2-tags-route
Add tags list display
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/TagRepository.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/TagRepository.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index 52f319f1..51f1cd42 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php | |||
@@ -3,7 +3,25 @@ | |||
3 | namespace Wallabag\CoreBundle\Repository; | 3 | namespace Wallabag\CoreBundle\Repository; |
4 | 4 | ||
5 | use Doctrine\ORM\EntityRepository; | 5 | use Doctrine\ORM\EntityRepository; |
6 | use Pagerfanta\Adapter\DoctrineORMAdapter; | ||
7 | use Pagerfanta\Pagerfanta; | ||
6 | 8 | ||
7 | class TagRepository extends EntityRepository | 9 | class TagRepository extends EntityRepository |
8 | { | 10 | { |
11 | /** | ||
12 | * Find Tags. | ||
13 | * | ||
14 | * @param int $userId | ||
15 | * | ||
16 | * @return array | ||
17 | */ | ||
18 | public function findTags($userId) | ||
19 | { | ||
20 | $qb = $this->createQueryBuilder('t') | ||
21 | ->where('t.user =:userId')->setParameter('userId', $userId); | ||
22 | |||
23 | $pagerAdapter = new DoctrineORMAdapter($qb); | ||
24 | |||
25 | return new Pagerfanta($pagerAdapter); | ||
26 | } | ||
9 | } | 27 | } |