You are here

public function LogMessage::getUser in File Log 8

Same name and namespace in other branches
  1. 2.0.x src/LogMessage.php \Drupal\filelog\LogMessage::getUser()

Get the user who triggered the message.

Return value

\Drupal\user\UserInterface The user object.

File

src/LogMessage.php, line 233

Class

LogMessage
Represents a single log event.

Namespace

Drupal\filelog

Code

public function getUser() : UserInterface {
  if (!$this->user) {
    $this->user = User::load($this->context['uid']);
  }
  return $this->user;
}