Exemplo n.º 1
0
 /**
  * @param array $token - токен
  * @param $password - пароль
  * @param array $config - праметры
  */
 public function __construct($token, $password, $config = [])
 {
     if (empty($token) || !is_string($token)) {
         throw new InvalidParamException(Yii::t('user', 'Ключ для восстановления пароля не найден.'));
     }
     if (empty($password) || !is_string($password)) {
         throw new InvalidParamException(Yii::t('user', 'Пароль не задан.'));
     }
     $this->_user = User::findByPasswordResetToken($token);
     $this->password = $password;
     if (!$this->_user) {
         throw new InvalidParamException(Yii::t('user', 'Неправильный ключ для восстановления пароля.'));
     }
     parent::__construct($config);
 }