aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Repository/TagRepository.php18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php
index c567317e..abf915fe 100644
--- a/src/Wallabag/CoreBundle/Repository/TagRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php
@@ -7,20 +7,6 @@ use Doctrine\ORM\EntityRepository;
7class TagRepository extends EntityRepository 7class TagRepository extends EntityRepository
8{ 8{
9 /** 9 /**
10 * Return only the QueryBuilder to retrieve all tags for a given user.
11 *
12 * @param int $userId
13 *
14 * @return QueryBuilder
15 */
16 private function getQbForAllTags($userId)
17 {
18 return $this->createQueryBuilder('t')
19 ->leftJoin('t.entries', 'e')
20 ->where('e.user = :userId')->setParameter('userId', $userId);
21 }
22
23 /**
24 * Find Tags. 10 * Find Tags.
25 * 11 *
26 * @param int $userId 12 * @param int $userId
@@ -29,7 +15,9 @@ class TagRepository extends EntityRepository
29 */ 15 */
30 public function findAllTags($userId) 16 public function findAllTags($userId)
31 { 17 {
32 return $this->getQbForAllTags($userId) 18 return $this->createQueryBuilder('t')
19 ->leftJoin('t.entries', 'e')
20 ->where('e.user = :userId')->setParameter('userId', $userId)
33 ->getQuery() 21 ->getQuery()
34 ->getResult(); 22 ->getResult();
35 } 23 }