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']);
 }
Beispiel #2
0
 public function getProfile()
 {
     return $this->hasOne(Profile::className(), ['user_id' => 'id']);
 }
Beispiel #3
0
 public function getCommentOwner()
 {
     return $this->hasOne(Profile::className(), ['user_id' => 'user_id']);
 }
Beispiel #4
0
 public function getTopProfile()
 {
     return $this->hasOne(Profile::className(), ['user_id' => 'psychologist_id']);
 }
Beispiel #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProfiles()
 {
     return $this->hasMany(Profile::className(), ['region_id' => 'id']);
 }
Beispiel #6
0
 public function getProfile()
 {
     return $this->hasOne(Profile::className(), ['user_id' => 'user_id'])->setModelScenario(Profile::SCENARIO_LIMITED);
 }
Beispiel #7
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getMessageFrom()
 {
     return $this->hasOne(Profile::className(), ['user_id' => 'message_from']);
 }
Beispiel #8
0
 /** @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);
 }
Beispiel #9
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getProfiles()
 {
     return $this->hasMany(\app\models\Profile::className(), ['user_id' => 'id']);
 }