You are here

public function OpignoNotification::getUser in Opigno notifications 8

Same name and namespace in other branches
  1. 3.x src/Entity/OpignoNotification.php \Drupal\opigno_notification\Entity\OpignoNotification::getUser()

Gets the notification receiver.

Return value

int|null The user id for the notification receiver, or NULL if not found.

Overrides OpignoNotificationInterface::getUser

File

src/Entity/OpignoNotification.php, line 154

Class

OpignoNotification
Defines the opigno_notification entity.

Namespace

Drupal\opigno_notification\Entity

Code

public function getUser() {
  $value = $this
    ->get('uid')
    ->getValue();
  if (!isset($value)) {
    return NULL;
  }
  return $value[0]['target_id'];
}