You are here

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

OpignoNotificationManager constructor.

Parameters

\Drupal\Core\Session\AccountInterface $account: The current user account.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager service.

File

src/Services/OpignoNotificationManager.php, line 38

Class

OpignoNotificationManager
Opigno notification manager service.

Namespace

Drupal\opigno_notification\Services

Code

public function __construct(AccountInterface $account, EntityTypeManagerInterface $entity_type_manager) {
  $uid = (int) $account
    ->id();
  try {
    $this->user = $entity_type_manager
      ->getStorage('user')
      ->load($uid);
  } catch (PluginNotFoundException|InvalidPluginDefinitionException $e) {
    watchdog_exception('opigno_notification_exception', $e);
  }
}