]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/Repository/NotificationRepository.php
First draft for notifications
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / NotificationRepository.php
1 <?php
2
3 namespace Wallabag\CoreBundle\Repository;
4
5 use Doctrine\ORM\EntityRepository;
6
7 class NotificationRepository extends EntityRepository {
8
9 public function markAllAsReadForUser($userId) {
10 return $this->getEntityManager()->createQueryBuilder()
11 ->update('WallabagCoreBundle:Notification', 'n')
12 ->set('n.read', true)
13 ->where('n.user = :userId')->setParameter('userId', $userId)
14 ->getQuery()
15 ->getResult();
16 }
17 }