3 namespace Wallabag\CoreBundle\Repository
;
5 use Doctrine\ORM\EntityRepository
;
7 class NotificationRepository
extends EntityRepository
9 public function markAllAsReadForUser($userId)
11 return $this->getEntityManager()->createQueryBuilder()
12 ->update('WallabagCoreBundle:Notification', 'n')
14 ->where('n.user = :userId')->setParameter('userId', $userId)
19 public function getBuilderForNotificationsByUser($userId)
21 return $this->createQueryBuilder('n')
22 ->andWhere('n.user = :userId')->setParameter('userId', $userId)
23 ->orderBy('n.timestamp', 'desc')