getDoctrine()->getRepository('WallabagCoreBundle:Notification')->findByUser($this->getUser()); return $this->render('WallabagCoreBundle:Notification:notifications.html.twig', ['notifications' => $notifications]); } /** * @Route("/notifications/readall", name="notification-archive-all") * * @param Request $request * @return Response */ public function markAllNotificationsAsReadAction(Request $request) { $this->getDoctrine()->getRepository('WallabagCoreBundle:Notification')->markAllAsReadForUser($this->getUser()->getId()); return $this->redirectToRoute('notifications-all'); } /** * @Route("/notifications/read/{notification}", name="notification-archive") * * @param Notification $notification * @return Response */ public function markNotificationsAsReadAction(Notification $notification) { $em = $this->getDoctrine()->getManager(); $notification->setRead(true); $em->persist($notification); $em->flush(); return $this->redirectToRoute('notifications-all'); } }