FormBuilder::currentUser

protected FormBuilder::currentUser()

Gets the current active user.

Return value

\Drupal\Core\Session\AccountInterface

File

core/lib/Drupal/Core/Form/FormBuilder.php, line 1385

Class

FormBuilder
Provides form building and processing.

Namespace

Drupal\Core\Form

Code

protected function currentUser() {
  if (!$this->currentUser && \Drupal::hasService('current_user')) {
    $this->currentUser = \Drupal::currentUser();
  }
  return $this->currentUser;
}
doc_Drupal
2016-10-29 09:15:23
Comments
Leave a Comment

Please login to continue.