diff --git a/common/models/Question.php b/common/models/Question.php index 74ada49..a3c8586 100644 --- a/common/models/Question.php +++ b/common/models/Question.php @@ -150,5 +150,12 @@ { return $this->hasOne(Doctor::className(), [ 'id' => 'doctor_id' ]); } + + public function getEntityObject(){ + if ($this->entity !== null){ + return $this->hasOne($this->entity, ['id' => 'entity_id']); + } + return null; + } } -- libgit2 0.21.4