aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-26 14:25:40 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-03-06 21:09:15 +0100
commit0ca374e6a1698926b08635d6a276ff3bf91c76a5 (patch)
tree19bd58fb1595ed8cf256f5624f903b177b482e4a /src/Wallabag/CoreBundle/Repository
parentd8f9f37ab2deb172f8dfc58b3b3775990188762f (diff)
downloadwallabag-0ca374e6a1698926b08635d6a276ff3bf91c76a5.tar.gz
wallabag-0ca374e6a1698926b08635d6a276ff3bf91c76a5.tar.zst
wallabag-0ca374e6a1698926b08635d6a276ff3bf91c76a5.zip
replace Response with JsonResponse
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository')
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php8
-rw-r--r--src/Wallabag/CoreBundle/Repository/TagRepository.php14
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
7class TagRepository extends EntityRepository 7class 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}