Commit cda2afc42eb36298429f53e0a63ca81e12fdde0b

Authored by Anastasia
1 parent 9315e305

- question

Showing 1 changed file with 7 additions and 0 deletions   Show diff stats
common/models/Question.php
@@ -150,5 +150,12 @@ @@ -150,5 +150,12 @@
150 { 150 {
151 return $this->hasOne(Doctor::className(), [ 'id' => 'doctor_id' ]); 151 return $this->hasOne(Doctor::className(), [ 'id' => 'doctor_id' ]);
152 } 152 }
  153 +
  154 + public function getEntityObject(){
  155 + if ($this->entity !== null){
  156 + return $this->hasOne($this->entity, ['id' => 'entity_id']);
  157 + }
  158 + return null;
  159 + }
153 160
154 } 161 }