User::setUsername

public User::setUsername($username)

Sets the username of this account.

Parameters

string $username: The new user name.

Return value

\Drupal\user\UserInterface The called user entity.

Overrides UserInterface::setUsername

File

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

Class

User
Defines the user entity class.

Namespace

Drupal\user\Entity

Code

public function setUsername($username) {
  $this->set('name', $username);
  return $this;
}
doc_Drupal
2016-10-29 09:52:10
Comments
Leave a Comment

Please login to continue.