/** * @param \ConsultBundle\Entity\DoctorQuestion $doctorQuestion */ public function __construct(DoctorQuestion $doctorQuestion) { parent::__construct($doctorQuestion->getQuestion()); $this->setId($doctorQuestion->getId()); $this->setState($doctorQuestion->getState()); //$this->images = $doctorQuestion->getQuestion()->getImages(); }
/** * @param \ConsultBundle\Entity\DoctorQuestion $doctorQuestion */ public function __construct(DoctorQuestion $doctorQuestion) { if (!empty($doctorQuestion)) { $question = $doctorQuestion->getQuestion(); parent::__construct($question); $this->setId($doctorQuestion->getId()); $this->setState($doctorQuestion->getState()); $this->setHasImages($question->getImages()->count()); $reply = $doctorQuestion->getDoctorReplies(); if (!empty($reply) && !$reply->isSoftDeleted()) { $rating = $doctorQuestion->getDoctorReplies()->getRating(); $this->setRating($rating); } } }
/** * @param \ConsultBundle\Entity\DoctorQuestion $doctorQuestionEntity * @param $practoAccountId * * @return \ConsultBundle\Response\DoctorQuestionResponseObject|null * @throws \HttpException */ protected function fetchDetailDoctorQuestionObject(DoctorQuestion $doctorQuestionEntity, $practoAccountId) { if (empty($doctorQuestionEntity)) { return null; } $questionEntity = $doctorQuestionEntity->getQuestion(); $question = null; if (!empty($questionEntity)) { if (!$questionEntity->getUserInfo()->isIsRelative()) { $this->userProfileUtil->retrieveUserProfileNew($questionEntity->getUserInfo()); } } $question = new DoctorQuestionResponseObject($doctorQuestionEntity); $this->fetchDetailQuestionObject($questionEntity, $practoAccountId, $question); $images = $this->helper->getRepository(ConsultConstants::QUESTION_ENTITY_NAME)->getImagesForAQuestion($questionEntity); $question->setImages($images); return $question; }