You are here

protected function LinkBase::currentUser in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/field/LinkBase.php \Drupal\views\Plugin\views\field\LinkBase::currentUser()

Gets the current active user.

@todo: https://www.drupal.org/node/2105123 put this method in \Drupal\Core\Plugin\PluginBase instead.

Return value

\Drupal\Core\Session\AccountInterface The current user.

1 call to LinkBase::currentUser()
LinkBase::checkUrlAccess in core/modules/views/src/Plugin/views/field/LinkBase.php
Checks access to the link route.

File

core/modules/views/src/Plugin/views/field/LinkBase.php, line 78
Contains \Drupal\views\Plugin\views\field\LinkBase.

Class

LinkBase
Field handler to present a link to an entity.

Namespace

Drupal\views\Plugin\views\field

Code

protected function currentUser() {
  if (!$this->currentUser) {
    $this->currentUser = \Drupal::currentUser();
  }
  return $this->currentUser;
}