aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/WallabagBundle/Repository
diff options
context:
space:
mode:
Diffstat (limited to 'src/WallabagBundle/Repository')
-rw-r--r--src/WallabagBundle/Repository/EntriesRepository.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/WallabagBundle/Repository/EntriesRepository.php b/src/WallabagBundle/Repository/EntriesRepository.php
new file mode 100644
index 00000000..4c13c9c2
--- /dev/null
+++ b/src/WallabagBundle/Repository/EntriesRepository.php
@@ -0,0 +1,35 @@
1<?php
2
3namespace WallabagBundle\Repository;
4
5use Doctrine\ORM\Query;
6use Doctrine\ORM\EntityRepository;
7
8/**
9 * EntriesRepository
10 *
11 * This class was generated by the Doctrine ORM. Add your own custom
12 * repository methods below.
13 */
14class EntriesRepository extends EntityRepository
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)
25 {
26 $qb = $this->createQueryBuilder('e')
27 ->select('e')
28 ->where('e.isRead = 0')
29 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
30 ->getQuery()
31 ->getResult(Query::HYDRATE_ARRAY);
32
33 return $qb;
34 }
35}