/**
  * @inheritdoc
  */
 protected function loadAttributes(\dektrium\user\models\User $user)
 {
     $user->setAttributes(['email' => $this->email, 'username' => $this->username, 'password' => $this->password]);
     $profile = \Yii::createObject(Profile::className());
     $profile->setAttributes(['name' => ucwords(strtolower($this->firstname)) . " " . ucwords(strtolower($this->lastname)), 'firstname' => ucwords(strtolower($this->firstname)), 'lastname' => ucwords(strtolower($this->lastname)), 'birthday' => $this->birthday, 'terms' => $this->terms]);
     $user->setProfile($profile);
 }
예제 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProfile()
 {
     return $this->hasOne($this->module->modelMap['Profile'], ['user_id' => 'id'])->from(Profile::tableName() . ' AS profile');
 }