You are here

protected function UserTrackerTab::currentUser in Drupal 8

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 28

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;
}