User::setPassword

public User::setPassword($password)

Sets the user password.

Parameters

string $password: The new unhashed password.

Return value

\Drupal\user\UserInterface The called user entity.

Overrides UserInterface::setPassword

File

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

Class

User
Defines the user entity class.

Namespace

Drupal\user\Entity

Code

public function setPassword($password) {
  $this->get('pass')->value = $password;
  return $this;
}
doc_Drupal
2016-10-29 09:52:10
Comments
Leave a Comment

Please login to continue.