You are here

public function ActivityNotifications::markAllNotificationsAsSeen in Open Social 8.9

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

Mark all notifications as Seen for account.

Parameters

\Drupal\Core\Session\AccountInterface $account: Account object.

Return value

bool TRUE or FALSE depending upon update status.

File

modules/custom/activity_creator/src/ActivityNotifications.php, line 143

Class

ActivityNotifications
Class ActivityNotifications to get Personalised activity items for account.

Namespace

Drupal\activity_creator

Code

public function markAllNotificationsAsSeen(AccountInterface $account) : bool {

  // Retrieve all the activities referring this entity for this account.
  if (!empty($ids = $this
    ->getNotificationIds($account, [
    ACTIVITY_STATUS_RECEIVED,
  ]))) {
    return $this
      ->changeStatusOfActivity($ids, $account, ACTIVITY_STATUS_SEEN);
  }
  return FALSE;
}