/** * @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; }
public function getUser() { return $this->hasOne(User::className(), ['id' => 'user_id']); }
public function getUser() { return $this->hasOne(User::className(), ['user_id' => 'user_id'])->onCondition('bmp_user.user_id is not null'); }