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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.