From cda2afc42eb36298429f53e0a63ca81e12fdde0b Mon Sep 17 00:00:00 2001 From: Anastasia Date: Fri, 6 Jul 2018 13:54:54 +0300 Subject: [PATCH] - question --- common/models/Question.php | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) 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