/** * Initializes the class map. */ protected function initClassMap() { $this->classMap = ArrayHelper::merge([self::CLASS_ACCOUNT => Account::className(), self::CLASS_TOKEN => AccountToken::className(), self::CLASS_PROVIDER => AccountProvider::className(), self::CLASS_LOGIN_HISTORY => AccountLoginHistory::className(), self::CLASS_PASSWORD_HISTORY => AccountPasswordHistory::className(), self::CLASS_LOGIN_FORM => LoginForm::className(), self::CLASS_PASSWORD_FORM => PasswordForm::className(), self::CLASS_SIGNUP_FORM => SignupForm::className(), self::CLASS_CONNECT_FORM => ConnectForm::className(), self::CLASS_FORGOT_PASSWORD_FORM => ForgotPasswordForm::className(), self::CLASS_WEB_USER => User::className(), self::CLASS_CAPTCHA => Captcha::className(), self::CLASS_CAPTCHA_ACTION => CaptchaAction::className(), self::CLASS_PASSWORD_BEHAVIOR => PasswordAttributeBehavior::className(), self::CLASS_PASSWORD_VALIDATOR => PasswordStrengthValidator::className()], $this->classMap); }
/** * @return \yii\db\ActiveQuery */ public function getAccount() { return $this->hasOne(Account::className(), ['id' => 'accountId']); }
/** * @inheritdoc */ public function rules() { return [[['email', 'username'], 'required'], ['username', 'string', 'min' => Module::getParam(Module::PARAM_MIN_USERNAME_LENGTH)], ['email', 'email'], [['username', 'email'], 'unique', 'targetClass' => Account::className()]]; }