function showNotification($id, Application $app) { // get $repo = new UserNotificationRepository(); $notification = $repo->loadByIdForUser($id, $app['currentUser']); // Mark read $repo->markRead($notification); // Redirect $url = $notification->getNotificationURL(); return $app->redirect($url); }