aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository/NotificationRepository.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2017-05-12 15:02:32 +0200
committerThomas Citharel <tcit@tcit.fr>2017-05-25 19:09:52 +0200
commit22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b (patch)
tree221d5cbf49107a83f223dae6afd8db8fab6ede1f /src/Wallabag/CoreBundle/Repository/NotificationRepository.php
parent35941d57ee4d06ec3557d4b126d5f6fd263bcf3a (diff)
downloadwallabag-22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b.tar.gz
wallabag-22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b.tar.zst
wallabag-22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b.zip
First draft for notifications
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/NotificationRepository.php')
-rw-r--r--src/Wallabag/CoreBundle/Repository/NotificationRepository.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/NotificationRepository.php b/src/Wallabag/CoreBundle/Repository/NotificationRepository.php
new file mode 100644
index 00000000..eb8dbb3e
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Repository/NotificationRepository.php
@@ -0,0 +1,17 @@
1<?php
2
3namespace Wallabag\CoreBundle\Repository;
4
5use Doctrine\ORM\EntityRepository;
6
7class 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}