diff options
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 | } |