You are here

protected function UserTrackerTab::currentUser in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/tracker/src/Plugin/Menu/UserTrackerTab.php \Drupal\tracker\Plugin\Menu\UserTrackerTab::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

File

core/modules/tracker/src/Plugin/Menu/UserTrackerTab.php, line 33
Contains \Drupal\tracker\Plugin\Menu\UserTrackerTab.

Class

UserTrackerTab
Provides route parameters needed to link to the current user tracker tab.

Namespace

Drupal\tracker\Plugin\Menu

Code

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