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


PHP Provider::setPersonId方法代码示例

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


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

示例1: newAction

 public function newAction()
 {
     $colIndex = $this->_getParam('colIndex');
     $sessionFilters = $this->_calendarSession->filter;
     if (!isset($sessionFilters->columns[$colIndex])) {
         $msg = __('Cannot generate column with that index, there is no filter defined for that column Index: ') . $colIndex;
         throw new Exception($msg);
     }
     $column = $sessionFilters->columns[$colIndex];
     $providerId = (int) $column['providerId'];
     $this->view->providerId = $providerId;
     $headerText = '';
     if ($providerId > 0) {
         $provider = new Provider();
         $provider->setPersonId($providerId);
         $provider->populate();
         $headerText = $provider->displayName;
     }
     $roomId = 0;
     if (isset($column['roomId'])) {
         $roomId = $column['roomId'];
     }
     $this->view->roomId = $roomId;
     if ($roomId > 0) {
         $room = new Room();
         $room->id = $roomId;
         $room->populate();
         $headerText .= ' -> ' . $room->name;
     }
     if (isset($column['dateFilter'])) {
         $headerText .= " ({$column['dateFilter']})";
     }
     $this->view->headerText = $headerText;
     $templates = array('' => '');
     $templates['tpl1'] = 'Provider 1 Template';
     $templates['tpl2'] = 'Provider 2 Template';
     $templates['tpl3'] = 'Provider 3 Template';
     $this->view->templates = $templates;
     // $this->_calendarSession->filter; calendar filter
     $this->render('new');
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:41,代码来源:ScheduleController.php

示例2: _generateEventColumnData

 protected function _generateEventColumnData(array $filters)
 {
     // filters assume to be sanitized
     $appointment = new Appointment();
     $appointment->providerId = $filters['providerId'];
     $appointment->roomId = $filters['roomId'];
     $appointment->start = $filters['dateFilter'] . ' ' . self::FILTER_TIME_START;
     $appointment->end = $filters['dateFilter'] . ' ' . self::FILTER_TIME_END;
     $startTime = strtotime($appointment->start);
     $endTime = strtotime($appointment->end);
     // we need to get the length of time to create number of rows in the grid
     $timeLen = ($endTime - $startTime) / 60 / self::FILTER_MINUTES_INTERVAL;
     // NOTE: height is 22px for xp, default 20px
     // prepopulate return data
     $columnData = array();
     //$maps = array();
     $start = $startTime;
     $end = $endTime;
     $ctr = 0;
     while ($start <= $end) {
         $map = array();
         $map['start'] = $start;
         $start = strtotime('+' . self::FILTER_MINUTES_INTERVAL . ' minutes', $start);
         $map['end'] = $start;
         //$maps[$ctr] = $map;
         $row = array();
         // assign row id as rowNumber and columnIndex
         $columnData[$ctr] = array('id' => $ctr + 1, 'data' => array(''), 'map' => $map);
         $ctr++;
     }
     $columnDataCtr = count($columnData);
     $data = array('apps' => array(), 'events' => array());
     $mapIndex = 0;
     $apps = array();
     foreach ($appointment->getIter() as $app) {
         $start = strtotime($app->start);
         for ($i = $mapIndex; $i < $columnDataCtr; $i++) {
             $map = $columnData[$mapIndex]['map'];
             $mapIndex = $i;
             if ($start >= $map['start'] && $start <= $map['end']) {
                 if (!isset($data['apps'][$i])) {
                     $data['apps'][$i] = array();
                 }
                 $data['apps'][$i][] = $app;
                 break;
             }
         }
     }
     $mapIndex = 0;
     $events = array();
     trigger_error('looping schedule event started');
     $scheduleEvent = new ScheduleEvent();
     $db = Zend_Registry::get('dbAdapter');
     $sqlSelect = $db->select()->from('scheduleEvents')->where('providerId = ?', $appointment->providerId)->where('roomId = ?', $appointment->roomId)->where('start >= ?', $appointment->start)->where('end <= ?', $appointment->end)->where('start <= end')->order('start ASC');
     $stmt = $db->query($sqlSelect);
     $stmt->setFetchMode(Zend_Db::FETCH_ASSOC);
     while ($row = $stmt->fetch()) {
         $event = new ScheduleEvent();
         $event->populateWithArray($row);
         $start = strtotime($event->start);
         for ($i = $mapIndex; $i < $columnDataCtr; $i++) {
             $map = $columnData[$i]['map'];
             $mapIndex = $i;
             if ($start >= $map['start'] && $start <= $map['end']) {
                 if (!isset($data['events'][$i])) {
                     $data['events'][$i] = array();
                 }
                 $data['events'][$i] = $event;
                 break;
             }
         }
     }
     trigger_error('looping schedule event ended');
     $colMultiplier = 1;
     $zIndex = 0;
     foreach ($data['apps'] as $index => $apps) {
         $ctr = count($apps);
         $columnData[$index]['userdata']['ctr'] = $ctr;
         if ($ctr > $colMultiplier) {
             $colMultiplier = $ctr;
         }
         for ($i = 0; $i < $ctr; $i++) {
             $app = $apps[$i];
             $this->_populateAppointmentRow($app, $columnData, $index, $i, $ctr);
         }
     }
     $header = "{$filters['dateFilter']}<br>";
     $title = $filters['dateFilter'];
     // temporarily set the header as providerId
     $providerId = (int) $filters['providerId'];
     $roomId = (int) $filters['roomId'];
     if ($providerId > 0) {
         $provider = new Provider();
         $provider->setPersonId($providerId);
         $provider->populate();
         $name = $provider->optionName;
         // we simply replace the comma with its html equivalent (&#44;) because this may cause not to render the header
         $header .= str_replace(',', '&#44;', $name);
         $title .= ' -> ' . $name;
     }
//.........这里部分代码省略.........
开发者ID:dragonlet,项目名称:clearhealth,代码行数:101,代码来源:CalendarController.php

示例3: listHistoryAction

 public function listHistoryAction()
 {
     $personId = (int) $this->_getParam('personId');
     $future = (int) $this->_getParam('future');
     $rows = array();
     $appointmentTemplate = new AppointmentTemplate();
     $reasons = $appointmentTemplate->getAppointmentReasons();
     $iterator = new AppointmentIterator(null, false);
     $filters = array('patientId' => $personId);
     if ($future) {
         $filters['start'] = date('Y-m-d');
     }
     $iterator->setFilters($filters);
     foreach ($iterator as $app) {
         $personId = (int) $app->patientId;
         $appointmentId = (int) $app->appointmentId;
         $providerId = (int) $app->providerId;
         $roomId = (int) $app->roomId;
         list($dateStart, $timeStart) = explode(' ', $app->start);
         list($dateEnd, $timeEnd) = explode(' ', $app->end);
         $providerName = '';
         if ($providerId > 0) {
             $provider = new Provider();
             $provider->setPersonId($providerId);
             $provider->populate();
             $providerName = $provider->displayName;
         }
         $roomName = '';
         if ($roomId > 0) {
             $room = new Room();
             $room->setRoomId($roomId);
             $room->populate();
             $roomName = $room->displayName;
         }
         $routing = new Routing();
         $routing->personId = $personId;
         $routing->appointmentId = $appointmentId;
         $routing->providerId = $providerId;
         $routing->roomId = $roomId;
         $routing->populateByAppointments();
         $station = $routing->stationId;
         $reason = $app->reason;
         $appointmentReason = isset($reasons[$reason]) ? $reasons[$reason]['name'] : '';
         $row = array();
         $row['id'] = $appointmentId;
         $row['data'] = array();
         $row['data'][] = $dateStart;
         $row['data'][] = $timeStart . ' - ' . $timeEnd;
         $row['data'][] = $providerName;
         $row['data'][] = $app->title;
         $row['data'][] = $roomName;
         $row['data'][] = $appointmentReason;
         $row['data'][] = $app->appointmentCode;
         $row['data'][] = $routing->stationId;
         $rows[] = $row;
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(array('rows' => $rows));
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:60,代码来源:AppointmentController.php

示例4: _generateColumnHeader

 protected function _generateColumnHeader(array $column)
 {
     $data = array();
     $data['header'] = "{$column['dateFilter']}<br>";
     $title = $column['dateFilter'];
     // temporarily set the header as providerId
     $providerId = $column['providerId'];
     $roomId = 0;
     if (isset($column['roomId'])) {
         $roomId = $column['roomId'];
     }
     if ($providerId > 0) {
         $provider = new Provider();
         $provider->setPersonId($providerId);
         $provider->populate();
         $name = $provider->last_name . ', ' . $provider->first_name;
         // we simply replace the comma with its html equivalent (&#44;) because this may cause not to render the header
         $data['header'] .= str_replace(',', '&#44;', $name);
         $title .= ' -> ' . $name;
     }
     if ($roomId > 0) {
         $room = new Room();
         $room->id = $roomId;
         $room->populate();
         if ($providerId > 0) {
             //$data['header'] .= '<br>';
             $data['header'] .= ' - ';
         }
         $data['header'] .= $room->name;
         $title .= ' -> ' . $room->name;
     }
     $data['header'] = '<label title="' . $title . '">' . $data['header'] . '</label>';
     return $data;
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:34,代码来源:CalendarController.php


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