function AccountProxy::getUsername

Overrides AccountInterface::getUsername

File

core/lib/Drupal/Core/Session/AccountProxy.php, line 153

Class

AccountProxy
A proxied implementation of AccountInterface.

Namespace

Drupal\Core\Session

Code

public function getUsername() {
    @trigger_error('\\Drupal\\Core\\Session\\AccountInterface::getUsername() is deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. Use \\Drupal\\Core\\Session\\AccountInterface::getAccountName() or \\Drupal\\user\\UserInterface::getDisplayName() instead. See https://www.drupal.org/node/2572493', E_USER_DEPRECATED);
    return $this->getAccountName();
}

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