当前位置: 首页>>代码示例>>PHP>>正文


PHP Appointment::persist方法代码示例

本文整理汇总了PHP中Appointment::persist方法的典型用法代码示例。如果您正苦于以下问题:PHP Appointment::persist方法的具体用法?PHP Appointment::persist怎么用?PHP Appointment::persist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Appointment的用法示例。


在下文中一共展示了Appointment::persist方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ajaxMarkAppointmentAction

 public function ajaxMarkAppointmentAction()
 {
     $appointmentId = (int) $this->_getParam('appointmentId');
     $mark = $this->_getParam('mark');
     $app = new Appointment();
     $app->appointmentId = $appointmentId;
     $app->populate();
     //todo: compare provided mark against eligible in matching enumeration
     $app->appointmentCode = $mark;
     $app->persist();
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(true);
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:14,代码来源:AppointmentController.php

示例2: changeTimeAppointmentAction

 public function changeTimeAppointmentAction()
 {
     $appointmentId = (int) $this->_getParam('appointmentId');
     $time = date('H:i:s', strtotime($this->_getParam('time')));
     $forced = (int) $this->_getParam('forced');
     $app = new Appointment();
     $app->appointmentId = $appointmentId;
     $data = array('error' => 'Appointment does not exists');
     if ($app->populate()) {
         $app->lastChangeId = (int) Zend_Auth::getInstance()->getIdentity()->personId;
         $app->lastChangeDate = date('Y-m-d H:i:s');
         $startTime = strtotime($app->start);
         $endTime = strtotime($app->end);
         $diff = $endTime - $startTime;
         $x = explode(' ', date('Y-m-d H:i:s', $startTime));
         $date = $x[0];
         $start = strtotime($date . ' ' . $time);
         $end = $start + $diff;
         $app->start = date('Y-m-d H:i:s', $start);
         $app->end = date('Y-m-d H:i:s', $end);
         $data = array('appointmentId' => $appointmentId);
         if (!$forced && ($error = $app->checkRules())) {
             // prompt the user if the appointment being made would be a double book or is outside of schedule time.
             $data['confirmation'] = $error;
         } else {
             $app->persist();
             //trigger_error(print_r($params,true));
             $data['appointmentId'] = $app->appointmentId;
         }
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct($data);
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:34,代码来源:CalendarController.php

示例3: processAddAppointmentAction

 public function processAddAppointmentAction()
 {
     $appointment = $this->_getParam('appointment');
     $paramProviders = array();
     foreach ($appointment as $key => $val) {
         $providerPrefix = 'providerId-';
         if (substr($key, 0, strlen($providerPrefix)) == $providerPrefix) {
             $paramProviders[] = $val;
             unset($appointment[$key]);
         }
     }
     if (count($paramProviders) > 0) {
         // assign the first providerId
         $appointment['providerId'] = array_shift($paramProviders);
     }
     // extra providers if any, can be retrieved using $paramProviders variable, not sure where to place it
     $columnId = $this->_getParam('columnId');
     $rowId = $this->_getParam('rowId');
     $filter = $this->getCurrentDisplayFilter();
     if (strlen($columnId) <= 0) {
         // look for the column of the input provider
         if (strlen($appointment['providerId']) > 0) {
             foreach ($filter->columns as $index => $column) {
                 if ($column['providerId'] == $appointment['providerId']) {
                     $columnId = $index;
                     break;
                 }
             }
         }
         // in the meantime, no room checked, how are we going to check for the room?
     }
     if (!isset($filter->columns[$columnId])) {
         throw new Exception(__("Cannot generate column with that index, there is no filter defined for that column Index: ") . $columnId);
     }
     $column = $filter->columns[$columnId];
     $app = new Appointment();
     $app->populateWithArray($appointment);
     if ($app->appointmentId > 0) {
         $app->lastChangeId = (int) Zend_Auth::getInstance()->getIdentity()->personId;
         $app->lastChangeDate = date('Y-m-d H:i:s');
     } else {
         $app->creatorId = (int) Zend_Auth::getInstance()->getIdentity()->personId;
         $app->createdDate = date('Y-m-d H:i:s');
     }
     //$app->providerId = $appointment['providerId'];
     //$app->patientId = substr($appointment['patient'],stripos($appointment['patient'],'PID:') + 4);
     $app->walkin = isset($appointment['walkin']) ? 1 : 0;
     $app->start = $filter->date . ' ' . date('H:i:s', strtotime($appointment['start']));
     $app->end = $filter->date . ' ' . date('H:i:s', strtotime($appointment['end']));
     $app->persist();
     $data = array();
     $data['columnId'] = $columnId;
     $data['rowId'] = $rowId;
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct($data);
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:57,代码来源:CalendarController.php

示例4: ajaxStationFromAppointmentAction

 function ajaxStationFromAppointmentAction()
 {
     $appointmentId = (int) $this->_getParam('appointmentId');
     $stationId = $this->_getParam('stationId');
     trigger_error('st: ' . $stationId, E_USER_NOTICE);
     $personId = '';
     $routing = new Routing();
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $appointment = new Appointment();
     $appointment->appointmentId = $appointmentId;
     $appointment->populate();
     //appointment already arrived, prevent a dupe
     if ($appointment->arrived > 0) {
         return $json->direct(array(false));
     }
     $patientId = $appointment->patientId;
     $provider = new Provider();
     $provider->personId = $appointment->providerId;
     $provider->populate();
     if (strlen($stationId) > 0) {
         trigger_error('st: ' . $stationId, E_USER_NOTICE);
     } elseif (strlen($provider->routingStation) > 0) {
         $stationId = $provider->routingStation;
     } else {
         if ($appointment->roomId > 0) {
             $room = new Room();
             $room->roomId = $appointment->roomId;
             $room->populate();
             if (strlen($room->routingStation) > 0) {
                 $stationId = $room->routingStation;
             }
         }
     }
     $routing->personId = $appointment->patientId;
     $routing->stationId = $stationId;
     $routing->appointmentId = $appointment->appointmentId;
     $routing->providerId = $appointment->providerId;
     $routing->roomId = $appointment->roomId;
     $routing->timestamp = date('Y-m-d H:i:s');
     if ($routing->personId > 0 && strlen($stationId) > 0) {
         $appointment->arrived = 1;
         $appointment->persist();
         $routing->persist();
         return $json->direct(array(true));
     }
     return $json->direct(array(false));
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:48,代码来源:RoutingController.php


注:本文中的Appointment::persist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。