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