You are here

public function OpignoNotificationManager::getUserHeaderNotifications in Opigno notifications 3.x

Get user unread notifications (ILT + LM + standard ones).

Return value

array The list of user unread notifications (ILT + LM + standard ones).

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 call to OpignoNotificationManager::getUserHeaderNotifications()
OpignoNotificationManager::renderUserHeaderNotifications in src/Services/OpignoNotificationManager.php
Prepare the render array to display the list of user notifications.

File

src/Services/OpignoNotificationManager.php, line 58

Class

OpignoNotificationManager
Opigno notification manager service.

Namespace

Drupal\opigno_notification\Services

Code

public function getUserHeaderNotifications() : array {
  if (!$this->user instanceof UserInterface) {
    return [];
  }

  // Get upcoming ILT + Live meetings + standard notifications.
  $notifications = _opigno_ilt_upcoming($this->user);
  $notifications = array_merge($notifications, _opigno_moxtra_upcoming_live_meetings($this->user));
  return array_merge($notifications, OpignoNotification::getUnreadNotifications(NULL, 3));
}