diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-05-15 10:15:39 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-05-25 19:09:52 +0200 |
commit | 4fa9470f36b9dc8b000b06c7742c921a1df71e42 (patch) | |
tree | c317e4c728891574bf8df49a237751bedc4a6d74 /src/Wallabag/CoreBundle/Controller/NotificationsController.php | |
parent | 22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b (diff) | |
download | wallabag-4fa9470f36b9dc8b000b06c7742c921a1df71e42.tar.gz wallabag-4fa9470f36b9dc8b000b06c7742c921a1df71e42.tar.zst wallabag-4fa9470f36b9dc8b000b06c7742c921a1df71e42.zip |
changes and default actions
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/NotificationsController.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/NotificationsController.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/NotificationsController.php b/src/Wallabag/CoreBundle/Controller/NotificationsController.php index 24870b37..0717ff47 100644 --- a/src/Wallabag/CoreBundle/Controller/NotificationsController.php +++ b/src/Wallabag/CoreBundle/Controller/NotificationsController.php | |||
@@ -6,6 +6,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Symfony\Component\HttpFoundation\Request; | 7 | use Symfony\Component\HttpFoundation\Request; |
8 | use Symfony\Component\HttpFoundation\Response; | 8 | use Symfony\Component\HttpFoundation\Response; |
9 | use Wallabag\CoreBundle\Entity\Notification; | ||
9 | 10 | ||
10 | class NotificationsController extends Controller | 11 | class NotificationsController extends Controller |
11 | { | 12 | { |
@@ -35,4 +36,22 @@ class NotificationsController extends Controller | |||
35 | 36 | ||
36 | return $this->redirectToRoute('notifications-all'); | 37 | return $this->redirectToRoute('notifications-all'); |
37 | } | 38 | } |
39 | |||
40 | /** | ||
41 | * @Route("/notifications/read/{notification}", name="notification-archive") | ||
42 | * | ||
43 | * @param Notification $notification | ||
44 | * @return Response | ||
45 | */ | ||
46 | public function markNotificationsAsReadAction(Notification $notification) | ||
47 | { | ||
48 | $em = $this->getDoctrine()->getManager(); | ||
49 | |||
50 | $notification->setRead(true); | ||
51 | |||
52 | $em->persist($notification); | ||
53 | $em->flush(); | ||
54 | |||
55 | return $this->redirectToRoute('notifications-all'); | ||
56 | } | ||
38 | } | 57 | } |