コード例 #1
0
 public function actionDelete($id)
 {
     if ($this->findModel(Profile::className(), $id)->delete() !== false) {
         $this->setFlash('success', \Yii::t('app', 'Modifications have been saved'));
     } else {
         $this->setFlash('error', \Yii::t('app', 'Modifications have not been saved'));
     }
     return $this->redirect(['/profile/index']);
 }
コード例 #2
0
ファイル: User.php プロジェクト: verve000/verve000
 public function getProfile()
 {
     return $this->hasOne(Profile::className(), ['user_id' => 'id']);
 }
コード例 #3
0
ファイル: VideosComments.php プロジェクト: Akelcehg/psycho
 public function getCommentOwner()
 {
     return $this->hasOne(Profile::className(), ['user_id' => 'user_id']);
 }
コード例 #4
0
ファイル: PsychologistTop.php プロジェクト: Akelcehg/psycho
 public function getTopProfile()
 {
     return $this->hasOne(Profile::className(), ['user_id' => 'psychologist_id']);
 }
コード例 #5
0
ファイル: Region.php プロジェクト: filimonchuk93/monitoring
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProfiles()
 {
     return $this->hasMany(Profile::className(), ['region_id' => 'id']);
 }
コード例 #6
0
ファイル: Employee.php プロジェクト: KleinMaximus/pickam
 public function getProfile()
 {
     return $this->hasOne(Profile::className(), ['user_id' => 'user_id'])->setModelScenario(Profile::SCENARIO_LIMITED);
 }
コード例 #7
0
ファイル: Messages.php プロジェクト: Ramengel/yii_fl
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getMessageFrom()
 {
     return $this->hasOne(Profile::className(), ['user_id' => 'message_from']);
 }
コード例 #8
0
ファイル: User.php プロジェクト: poykub/wph
 /** @inheritdoc */
 public function afterSave($insert, $changedAttributes)
 {
     if ($insert) {
         $profile = \Yii::createObject(['class' => Profile::className(), 'user_id' => $this->id, 'gravatar_email' => $this->email]);
         $profile->save(false);
     }
     parent::afterSave($insert, $changedAttributes);
 }
コード例 #9
0
ファイル: User.php プロジェクト: ICHydro/anaconda
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProfiles()
 {
     return $this->hasMany(\app\models\Profile::className(), ['user_id' => 'id']);
 }