aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/WallabagBundle/Repository
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-01-22 21:11:22 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-01-22 21:11:22 +0100
commitbd9f08157cc10619e9bb9dace6df43090dde44a9 (patch)
tree840b9f6819758ad0493c116ef3def2936358c891 /src/WallabagBundle/Repository
parent9d50517ceaeadaba227ccdbaa43a5918abd16728 (diff)
downloadwallabag-bd9f08157cc10619e9bb9dace6df43090dde44a9.tar.gz
wallabag-bd9f08157cc10619e9bb9dace6df43090dde44a9.tar.zst
wallabag-bd9f08157cc10619e9bb9dace6df43090dde44a9.zip
article view, fav list, archive list
Diffstat (limited to 'src/WallabagBundle/Repository')
-rw-r--r--src/WallabagBundle/Repository/EntriesRepository.php32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/WallabagBundle/Repository/EntriesRepository.php b/src/WallabagBundle/Repository/EntriesRepository.php
index 4c13c9c2..c355a012 100644
--- a/src/WallabagBundle/Repository/EntriesRepository.php
+++ b/src/WallabagBundle/Repository/EntriesRepository.php
@@ -13,14 +13,6 @@ use Doctrine\ORM\EntityRepository;
13 */ 13 */
14class EntriesRepository extends EntityRepository 14class EntriesRepository extends EntityRepository
15{ 15{
16 /* public function findUnreadByUser($userId)
17 {
18 return $this->createQueryBuilder('e')
19 ->where('e.is_read = 0')
20 ->andWhere('e.user_id = :userId')
21 ->setParameter('userId', $userId)
22 ->getQuery();
23 }*/
24 public function findUnreadByUser($userId) 16 public function findUnreadByUser($userId)
25 { 17 {
26 $qb = $this->createQueryBuilder('e') 18 $qb = $this->createQueryBuilder('e')
@@ -32,4 +24,28 @@ class EntriesRepository extends EntityRepository
32 24
33 return $qb; 25 return $qb;
34 } 26 }
27
28 public function findArchiveByUser($userId)
29 {
30 $qb = $this->createQueryBuilder('e')
31 ->select('e')
32 ->where('e.isRead = 1')
33 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
34 ->getQuery()
35 ->getResult(Query::HYDRATE_ARRAY);
36
37 return $qb;
38 }
39
40 public function findStarredByUser($userId)
41 {
42 $qb = $this->createQueryBuilder('e')
43 ->select('e')
44 ->where('e.isFav = 1')
45 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
46 ->getQuery()
47 ->getResult(Query::HYDRATE_ARRAY);
48
49 return $qb;
50 }
35} 51}