function User::getUsername

Overrides AccountInterface::getUsername

File

core/modules/user/src/Entity/User.php, line 375

Class

User
Defines the user entity class.

Namespace

Drupal\user\Entity

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.