/**
  * @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);
         }
     }
 }
Пример #3
0
 /**
  * @param      $question    - Object of Question Entity
  * @param      $doctorId    - Doctor's Practo Account Id
  *
  * @return null
  */
 private function createDoctorQuestionEntity($question, $doctorId)
 {
     $doctorQuestion = new DoctorQuestion();
     $doctorQuestion->setQuestion($question);
     $doctorQuestion->setPractoAccountId($doctorId);
     $this->helper->persist($doctorQuestion);
     return $doctorQuestion;
 }
Пример #4
0
 /**
  * @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;
 }