public function ActivityNotifications::getNotificationsActivities in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
- 8 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
- 8.2 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
- 8.3 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
- 8.4 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
- 8.5 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
- 8.6 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
- 8.7 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
- 8.8 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
- 10.3.x modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
- 10.1.x modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
- 10.2.x modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::getNotificationsActivities()
Returns the Activity objects with destination 'notification' for account.
Parameters
\Drupal\Core\Session\AccountInterface $account: Account object.
array $status: Status string: activity_creator_field_activity_status_allowed_values().
Return value
array Return array of notifications as activity objects or an empty array.
Throws
\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
\Drupal\Component\Plugin\Exception\PluginNotFoundException
File
- modules/
custom/ activity_creator/ src/ ActivityNotifications.php, line 75
Class
- ActivityNotifications
- Class ActivityNotifications to get Personalised activity items for account.
Namespace
Drupal\activity_creatorCode
public function getNotificationsActivities(AccountInterface $account, array $status = [
ACTIVITY_STATUS_RECEIVED,
]) : array {
if (!empty($ids = $this
->getNotificationIds($account, $status))) {
return $this
->entityTypeManager()
->getStorage('activity')
->loadMultiple($ids);
}
return [];
}