aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/NotificationsController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/NotificationsController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/NotificationsController.php19
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;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 6use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 7use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\HttpFoundation\Response; 8use Symfony\Component\HttpFoundation\Response;
9use Wallabag\CoreBundle\Entity\Notification;
9 10
10class NotificationsController extends Controller 11class 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}