]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/WallabagBundle/Repository/EntriesRepository.php
migrating legacy to symfony
[github/wallabag/wallabag.git] / src / WallabagBundle / Repository / EntriesRepository.php
1 <?php
2
3 namespace WallabagBundle\Repository;
4
5 use Doctrine\ORM\Query;
6 use 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 */
14 class 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 }