Example #1
0
 public function jsonSerialize()
 {
     $photo = $this->_doctor->getPhoto();
     $doctor = $this->_doctor;
     $data = array();
     if ($this->_addSchedule()) {
         $schedule = $doctor->getSchedule($this->_date)->jsonSerialize();
         if ($this->_isAvailable($schedule)) {
             $data['schedule'] = $schedule;
         } else {
             return false;
         }
     }
     $data = array_merge($data, array('id' => $doctor->getId(), 'name' => $doctor->getName(), 'photo' => $photo ? $photo->getPath(56, 56) : MedOptima_Photo::getDefaultDoctorPhoto()->getPhotoPath(), 'posts' => array_map(function (Application_Model_Medical_Post $post) {
         return $post->getName();
     }, $doctor->getPosts()), 'services' => $this->_serializeServices()));
     return $data;
 }
Example #2
0
 protected function _getDefaultPhoto()
 {
     return MedOptima_Photo::getDefaultDoctorPhoto();
 }