diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-05-12 15:02:32 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-05-25 19:09:52 +0200 |
commit | 22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b (patch) | |
tree | 221d5cbf49107a83f223dae6afd8db8fab6ede1f /src/Wallabag/CoreBundle/Controller | |
parent | 35941d57ee4d06ec3557d4b126d5f6fd263bcf3a (diff) | |
download | wallabag-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/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/NotificationsController.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/NotificationsController.php b/src/Wallabag/CoreBundle/Controller/NotificationsController.php new file mode 100644 index 00000000..24870b37 --- /dev/null +++ b/src/Wallabag/CoreBundle/Controller/NotificationsController.php | |||
@@ -0,0 +1,38 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Controller; | ||
4 | |||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
7 | use Symfony\Component\HttpFoundation\Request; | ||
8 | use Symfony\Component\HttpFoundation\Response; | ||
9 | |||
10 | class NotificationsController extends Controller | ||
11 | { | ||
12 | /** | ||
13 | * @param Request $request | ||
14 | * | ||
15 | * @Route("/notifications", name="notifications-all") | ||
16 | * | ||
17 | * @return \Symfony\Component\HttpFoundation\Response | ||
18 | */ | ||
19 | public function getAllNotificationsAction(Request $request) | ||
20 | { | ||
21 | $notifications = $this->getDoctrine()->getRepository('WallabagCoreBundle:Notification')->findByUser($this->getUser()); | ||
22 | |||
23 | return $this->render('WallabagCoreBundle:Notification:notifications.html.twig', ['notifications' => $notifications]); | ||
24 | } | ||
25 | |||
26 | /** | ||
27 | * @Route("/notifications/readall", name="notification-archive-all") | ||
28 | * | ||
29 | * @param Request $request | ||
30 | * @return Response | ||
31 | */ | ||
32 | public function markAllNotificationsAsReadAction(Request $request) | ||
33 | { | ||
34 | $this->getDoctrine()->getRepository('WallabagCoreBundle:Notification')->markAllAsReadForUser($this->getUser()->getId()); | ||
35 | |||
36 | return $this->redirectToRoute('notifications-all'); | ||
37 | } | ||
38 | } | ||