/** * @inheritdoc */ public function rules() { return [['email', 'filter', 'filter' => 'trim'], ['email', 'required'], ['email', 'email'], ['email', 'exist', 'targetClass' => User::className(), 'filter' => ['statusId' => User::STATUS_ACTIVE], 'message' => Yii::t('error', 'There is no user with such email.')]]; }
/** * @inheritdoc */ public function rules() { return [['email', 'filter', 'filter' => 'trim'], ['email', 'required'], ['email', 'email'], ['email', 'string', 'max' => 255], ['email', 'unique', 'targetClass' => User::className()], ['password', 'required'], ['password', PasswordValidator::className()], ['verifyCode', 'captcha']]; }
/** * @return \yii\db\ActiveQuery */ public function getUser() { return $this->hasOne(User::className(), ['id' => 'userId']); }