Exemplo n.º 1
0
 public function render($idLang)
 {
     $row = new RM_View_Form_Row();
     $row->setDesc($this->getDesc());
     $row->setHTML($this->getView()->partial(static::BASE_PATH . static::TPL, $this->addFieldData($idLang, array('isLinked' => $this->_accessToken instanceof Application_Model_Api_Google_AccessToken, 'linkUrl' => $this->_client ? $this->_client->createAuthUrl() : '', 'unlinkUrl' => $this->getView()->url(['idDoctor' => $this->_doctor->getId()], 'admin-unlink-google-account')))));
     return $this->renderRow($row);
 }
Exemplo n.º 2
0
 public function getFormattedPosts()
 {
     $posts = $this->_doctor->getPosts();
     foreach ($posts as &$post) {
         $post = $post->getName();
     }
     return join(', ', $posts);
 }
Exemplo n.º 3
0
 private function _serializeServices()
 {
     $services = [];
     foreach ($this->_doctor->getServices() as $service) {
         $services[] = $service->getId();
     }
     return $services;
 }
Exemplo n.º 4
0
 public function isAvailable(DateTime $from, DateTime $to = null, array $excludeReservations = array())
 {
     if (!$to) {
         $to = clone $from;
         $to->addSeconds($this->_doctor->getMinReceptionDuration()->getTimestamp());
     }
     if (!$this->isWorkingAt($from) || !$this->isWorkingAt($to)) {
         return false;
     }
     return !$this->_reservationService->hasReservationsBetween($from, $to, $excludeReservations);
 }
Exemplo n.º 5
0
 public function getDoctor()
 {
     if (!$this->_doctor && $this->getIdDoctor()) {
         $this->_doctor = Doctor::getById($this->getIdDoctor());
     }
     return $this->_doctor;
 }
Exemplo n.º 6
0
 private function _saveEntity()
 {
     $this->_entity->save();
     if (!$this->_workTimeService) {
         $this->_workTimeService = new MedOptima_Service_Doctor_WorkTime();
     }
     $this->_workTimeService->saveList($this->_workTimeList);
 }
Exemplo n.º 7
0
 private function _prepareServices()
 {
     $selectedServices = isset($this->_data->selectedServices) ? $this->_data->selectedServices : array();
     if (!is_array($selectedServices)) {
         $selectedServices = array();
     }
     if (!empty($selectedServices)) {
         foreach ($this->_doctor->getServices() as $service) {
             if (in_array($service->getId(), $selectedServices)) {
                 $this->_services[] = $service;
             }
         }
     }
 }
Exemplo n.º 8
0
 public function getFrom()
 {
     return Application_Model_Medical_Doctor::getById($this->getIdFrom());
 }
Exemplo n.º 9
0
 public function setDoctor(Doctor $doctor)
 {
     $this->_doctor = $doctor;
     $this->__setIdDoctor($doctor->getId());
 }
Exemplo n.º 10
0
 private function _redirectToDoctorEdit()
 {
     $this->redirect($this->view->url(['id' => $this->_doctor->getId(), 'page' => 1], 'admin-medical-doctor-edit'));
 }
Exemplo n.º 11
0
 public function setDoctor(Application_Model_Medical_Doctor $doctor)
 {
     $this->_getWhere()->add('idDoctor', '=', $doctor->getId());
 }
Exemplo n.º 12
0
 protected function __setData(stdClass $data)
 {
     $this->__setContentFields();
     $this->_entity->setDoctorResponse($data->response);
     $this->_entity->setVisitorQuestion($data->question);
     $this->_entity->setVisitorName($data->visitor_name);
     $this->_entity->setVisitorEmail($data->visitor_email);
     $doctor = Application_Model_Medical_Doctor::getById($data->id_doctor);
     if ($doctor instanceof Application_Model_Medical_Doctor) {
         $this->_entity->setDoctor($doctor);
     } else {
         $this->_entity->resetDoctor();
     }
     $this->_entity->setShownOnMain($data->shown_on_main);
 }
Exemplo n.º 13
0
 public function setDoctor(Doctor $doctor)
 {
     $this->_getWhere()->add('idDoctor', '=', $doctor->getId());
 }