src/entities/User.php
public function setPassword(string $password) : void
    {
        $this->password_hash = Yii::$app->security->generatePasswordHash($password);
    }
public function setPassword(string $password) : void
    {
        $this->password_hash = Yii::$app->security->generatePasswordHash($password);
    }
public function setPassword ( string $ password ) : void { $ this -> password_hash = Yii :: $ app -> security -> generatePasswordHash ( $ password ) ; }
Generates password hash from password and sets it to the model.
@param string $password
@return void
Generates password hash from password and sets it to the model .