You are here

public function NotificationsController::readNotificationCallback in Open Social 8.9

Same name and namespace in other branches
  1. 8 modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()
  2. 8.2 modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()
  3. 8.3 modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()
  4. 8.4 modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()
  5. 8.5 modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()
  6. 8.6 modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()
  7. 8.7 modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()
  8. 8.8 modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()
  9. 10.3.x modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()
  10. 10.0.x modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()
  11. 10.1.x modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()
  12. 10.2.x modules/custom/activity_creator/src/Controller/NotificationsController.php \Drupal\activity_creator\Controller\NotificationsController::readNotificationCallback()

Ajax callback to mark notifications as read.

Deprecated

in social:8.x-7.0 and is removed from social:8.x-8.0. Use NotificationsController::getNotificationListCallback() instead.

See also

https://www.drupal.org/project/social/issues/3056821

1 string reference to 'NotificationsController::readNotificationCallback'
activity_creator.routing.yml in modules/custom/activity_creator/activity_creator.routing.yml
modules/custom/activity_creator/activity_creator.routing.yml

File

modules/custom/activity_creator/src/Controller/NotificationsController.php, line 49

Class

NotificationsController
Notifications controller.

Namespace

Drupal\activity_creator\Controller

Code

public function readNotificationCallback() : AjaxResponse {

  // Create AJAX Response object.
  $response = new AjaxResponse();
  $data = [
    'remaining_notifications' => $this->activities
      ->markAllNotificationsAsSeen($this
      ->currentUser()),
  ];
  $response
    ->setData($data);

  // Return ajax response.
  return $response;
}