aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository/NotificationRepository.php
blob: eb8dbb3e6bbc4aaaf17b7d0f876d84e460172b86 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

namespace Wallabag\CoreBundle\Repository;

use Doctrine\ORM\EntityRepository;

class NotificationRepository extends EntityRepository {

    public function markAllAsReadForUser($userId) {
        return $this->getEntityManager()->createQueryBuilder()
        ->update('WallabagCoreBundle:Notification', 'n')
        ->set('n.read', true)
        ->where('n.user = :userId')->setParameter('userId', $userId)
        ->getQuery()
        ->getResult();
    }
}