Пример #1
0
 /**
  * Creates a form model given a token.
  *
  * @param  string                          $token
  * @param  array                           $config name-value pairs that will be used to initialize the object properties
  * @throws InvalidParamException if token is empty or not valid
  */
 public function __construct($token, $config = [])
 {
     if (empty($token) || !is_string($token)) {
         throw new InvalidParamException('Password reset token cannot be blank.');
     }
     $this->_user = Customer::findByPasswordResetToken($token);
     if (!$this->_user) {
         throw new InvalidParamException(\common\models\I18n::t('Wrong password reset token'));
     }
     parent::__construct($config);
 }