Exemple #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getRelative()
 {
     if ($this->relative_id != null) {
         $result = $this->hasOne(Relatives::className(), ['id' => 'relative_id']);
     } else {
         return $this->hasOne(Relatives::className(), ['id' => 'relative_id']);
     }
 }
Exemple #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getHusband()
 {
     return $this->hasOne(Relatives::className(), ['id' => 'husband_id']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getRelative()
 {
     return $this->hasOne(Relatives::className(), ['id' => 'relative_id']);
 }