diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository')
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/EntryRepository.php | 8 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/TagRepository.php | 14 |
2 files changed, 5 insertions, 17 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index e102edc7..04fe6aa3 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php | |||
@@ -128,9 +128,11 @@ class EntryRepository extends EntityRepository | |||
128 | { | 128 | { |
129 | $qb = $this->createQueryBuilder('e') | 129 | $qb = $this->createQueryBuilder('e') |
130 | ->innerJoin('e.tags', 't') | 130 | ->innerJoin('e.tags', 't') |
131 | ->addSelect('t') | 131 | ->innerJoin('e.user', 'u') |
132 | ->where('t.user=:userId')->setParameter('userId', 1); | 132 | ->addSelect('t', 'u') |
133 | ->where('e.user=:userId')->setParameter('userId', $userId) | ||
134 | ; | ||
133 | 135 | ||
134 | return $qb->getQuery()->getOneOrNullResult(); | 136 | return $qb->getQuery()->getResult(); |
135 | } | 137 | } |
136 | } | 138 | } |
diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index 0f362f79..52f319f1 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php | |||
@@ -6,18 +6,4 @@ use Doctrine\ORM\EntityRepository; | |||
6 | 6 | ||
7 | class TagRepository extends EntityRepository | 7 | class TagRepository extends EntityRepository |
8 | { | 8 | { |
9 | public function findByEntries($entryId) | ||
10 | { | ||
11 | $qb = $this->createQueryBuilder('t') | ||
12 | ->select('t') | ||
13 | ->leftJoin('t.id', 'u') | ||
14 | ->where('e.isStarred = true') | ||
15 | ->andWhere('u.id =:userId')->setParameter('userId', $userId) | ||
16 | ->orderBy('e.createdAt', 'desc') | ||
17 | ->getQuery(); | ||
18 | |||
19 | $paginator = new Paginator($qb); | ||
20 | |||
21 | return $paginator; | ||
22 | } | ||
23 | } | 9 | } |