/**
  * @inheritdoc
  */
 public function register()
 {
     if (!$this->validate()) {
         return false;
     }
     /** @var User $user */
     $user = Yii::createObject(User::className());
     $user->setScenario('register');
     $this->loadAttributes($user);
     if (!$user->register()) {
         return false;
     }
     $message = 'Your account has been created';
     if ($this->module->enableConfirmation || $this->module->enableGeneratingPassword) {
         $message .= ' and a message with further instructions has been sent to your email';
     }
     Yii::$app->session->setFlash('info', Yii::t('user', $message));
     return true;
 }
예제 #2
0
 public function getUser()
 {
     return $this->hasOne(User::className(), ['id' => 'user_id']);
 }
예제 #3
0
 public function getUser()
 {
     return $this->hasOne(User::className(), ['user_id' => 'user_id'])->onCondition('bmp_user.user_id is not null');
 }