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


PHP Provider::getIter方法代码示例

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


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

示例1: proceduresAction

 public function proceduresAction()
 {
     $visitId = (int) $this->_getParam('visitId');
     $visit = new Visit();
     $visit->visitId = $visitId;
     if ($visitId > 0) {
         $visit->populate();
     }
     $provider = new Provider();
     $providerIterator = $provider->getIter();
     $this->view->listProviders = $providerIterator->toArray('personId', 'displayName');
     $this->view->providerId = (int) $visit->providerId;
     $this->render();
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:14,代码来源:VisitSelectController.php

示例2: timeSearchAction

 public function timeSearchAction()
 {
     $columnId = (int) $this->_getParam('columnId');
     $filter = $this->getCurrentDisplayFilter($columnId);
     $columns = $filter->columns;
     if (!isset($columns[$columnId])) {
         throw new Exception(__('There is no filter defined for column Index: ') . $columnId);
     }
     $column = $columns[$columnId];
     $this->view->providerId = (int) $column['providerId'];
     $this->view->roomId = (int) $column['roomId'];
     $dateFilter = $column['dateFilter'];
     if (!strlen($dateFilter) > 0 || $dateFilter == '0000-00-00') {
         $dateFilter = date('Y-m-d');
     }
     $providers = array(0 => '');
     $provider = new Provider();
     foreach ($provider->getIter() as $row) {
         $providers[$row->providerId] = $row->optionName;
     }
     $this->view->providers = $providers;
     $rooms = array(0 => '');
     foreach (Room::getRoomArray() as $key => $value) {
         $rooms[$key] = $value;
     }
     $this->view->rooms = $rooms;
     $dateStart = date('Y-m-d', strtotime('+1 day', strtotime($dateFilter)));
     $startToTime = strtotime($dateStart);
     $months = array();
     for ($i = 0; $i < 4; $i++) {
         $months[] = array('month' => date('Y-m', $startToTime), 'jsmonth' => date('Y', $startToTime) . ((int) date('m', $startToTime) - 1), 'lastDay' => date('t', $startToTime));
         $startToTime = strtotime('+1 month', $startToTime);
     }
     $dateEnd = $months[3]['month'] . '-' . $months[3]['lastDay'];
     $this->view->months = $months;
     $this->view->dateStart = $dateStart;
     $this->view->dateEnd = $dateEnd;
     $this->view->timeStart = '00:00';
     $this->view->timeEnd = '23:59';
     $this->render();
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:41,代码来源:CalendarController.php

示例3: _generateSchedules

 protected function _generateSchedules()
 {
     // get all rooms, used in random schedule
     //$this->_generateRooms();
     $facilityIterator = new FacilityIterator();
     // used the FacilityIterator rather than the Room model
     $facilityIterator->setFilter(array('Room'));
     $rows = array();
     foreach ($facilityIterator as $room) {
         $rows[] = $room;
     }
     $dates = $this->_generateDays();
     // generate random schedules for each current provider
     $providerIterator = Provider::getIter();
     foreach ($providerIterator as $provider) {
         $rows[] = $provider;
     }
     foreach ($rows as $row) {
         $title = '';
         $roomId = 0;
         $providerId = 0;
         if ($row instanceof Room) {
             $roomId = (int) $row->id;
             $title = $row->name;
         } else {
             if ($row instanceof Provider) {
                 $providerId = (int) $row->personId;
                 $title = $row->person->firstName;
             }
         }
         $title .= "'s Event";
         // 08:00 - 12:00; 13:00 - 17:00
         // TODO: create a random time starts from 07:00 to 17:00
         $times = array();
         $time = array();
         $time['start'] = '08:00';
         $time['end'] = '12:00';
         $times[] = $time;
         $time = array();
         $time['start'] = '13:00';
         $time['end'] = '17:00';
         $times[] = $time;
         foreach ($dates as $date) {
             foreach ($times as $time) {
                 $scheduleEvent = new ScheduleEvent();
                 // disable cascadePersist, we only generate schedule event
                 $this->_setORMPersistMode($scheduleEvent);
                 //$scheduleEvent->scheduleEventId = 0; // must be set to 0 to add new schedule
                 //$scheduleEvent->scheduleCode = ''; // leave as empty
                 //$scheduleEvent->scheduleId = 0; // leave as empty
                 $scheduleEvent->title = $title;
                 $scheduleEvent->roomId = $roomId;
                 $scheduleEvent->providerId = $providerId;
                 $scheduleEvent->start = $date . ' ' . $time['start'];
                 $scheduleEvent->end = $date . ' ' . $time['end'];
                 $scheduleEvent->persist();
             }
         }
     }
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:60,代码来源:TestDataController.php

示例4: providersJsonAction

 public function providersJsonAction()
 {
     $provider = new Provider();
     $providerIterator = $provider->getIter();
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(array("rows" => $providerIterator->toJsonArray('personId', array('displayName'))), true);
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:8,代码来源:VisitDetailsController.php

示例5: patientAction

 public function patientAction()
 {
     if (!isset($this->_session->patientFilters)) {
         $this->_session->patientFilters = array();
     }
     $filters = $this->_session->patientFilters;
     if (!isset($filters['dateStart'])) {
         $filters['dateStart'] = date('Y-m-d', strtotime('-1 week'));
         $this->_session->patientFilters = $filters;
     }
     if (!isset($filters['dateEnd'])) {
         $filters['dateEnd'] = date('Y-m-d');
         $this->_session->patientFilters = $filters;
     }
     $this->view->filters = $filters;
     $this->view->personId = (int) $this->_getParam('personId');
     $facilities = array('' => '');
     $facilityIterator = new FacilityIterator();
     $facilityIterator->setFilter(array('Practice', 'Building', 'Room'));
     foreach ($facilityIterator as $facility) {
         $key = $facility['Practice']->practiceId . '_' . $facility['Building']->buildingId . '_' . $facility['Room']->roomId;
         $name = $facility['Practice']->name . '->' . $facility['Building']->name . '->' . $facility['Room']->name;
         $facilities[$key] = $name;
     }
     $this->view->facilities = $facilities;
     $payers = array('' => '');
     foreach (InsuranceProgram::getInsurancePrograms() as $key => $value) {
         $payers[$key] = $value;
     }
     $this->view->payers = $payers;
     $providers = array('' => '');
     $provider = new Provider();
     foreach ($provider->getIter() as $row) {
         $providers[$row->personId] = $row->displayName;
     }
     $this->view->providers = $providers;
     $users = array('' => '');
     $db = Zend_Registry::get('dbAdapter');
     $user = new User();
     $sqlSelect = $db->select()->from($user->_table)->order('username');
     foreach ($user->getIterator($sqlSelect) as $row) {
         $users[$row->userId] = $row->username;
     }
     $this->view->users = $users;
     $this->render();
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:46,代码来源:AccountsController.php

示例6: getReportAction

 public function getReportAction()
 {
     $baseId = (int) $this->_getParam('baseId');
     $data = array('filters' => array(), 'views' => array());
     $reportBase = new ReportBase();
     $reportBase->reportBaseId = $baseId;
     $reportBase->populate();
     foreach ($reportBase->reportFilters as $reportFilter) {
         $filter = array();
         $filter['id'] = $reportFilter->id;
         $filter['name'] = $reportFilter->name;
         $filter['defaultValue'] = $reportFilter->defaultValue;
         $filter['type'] = $reportFilter->type;
         $filter['options'] = $reportFilter->options;
         $list = null;
         if ($reportFilter->type == ReportBase::FILTER_TYPE_ENUM) {
             $enumerationClosure = new EnumerationClosure();
             $filter['enums'] = array();
             $paths = $enumerationClosure->generatePaths($reportFilter->enumName['id']);
             foreach ($paths as $id => $name) {
                 $filter['enums'][] = array('id' => $id, 'name' => $name);
             }
         } else {
             if ($reportFilter->type == ReportBase::FILTER_TYPE_QUERY) {
                 $reportQuery = new ReportQuery();
                 $reportQuery->reportQueryId = (int) $reportFilter->query;
                 $reportQuery->populate();
                 $filter['queries'] = $reportQuery->executeQuery();
                 if ($reportFilter->includeBlank) {
                     array_unshift($filter['queries'], array('id' => '', 'name' => '&amp;nbsp;'));
                 }
             } else {
                 if ($reportFilter->type == ReportBase::FILTER_TYPE_LIST_BUILDING) {
                     $orm = new Building();
                     $list = array('ormIterator' => $orm->getIterator(), 'id' => 'buildingId', 'name' => 'displayName');
                 } else {
                     if ($reportFilter->type == ReportBase::FILTER_TYPE_LIST_PRACTICE) {
                         $orm = new Practice();
                         $list = array('ormIterator' => $orm->getIterator(), 'id' => 'practiceId', 'name' => 'name');
                     } else {
                         if ($reportFilter->type == ReportBase::FILTER_TYPE_LIST_PROVIDER) {
                             $orm = new Provider();
                             $list = array('ormIterator' => $orm->getIter(), 'id' => 'personId', 'name' => 'displayName');
                         } else {
                             if ($reportFilter->type == ReportBase::FILTER_TYPE_LIST_ROOM) {
                                 $orm = new Room();
                                 $list = array('ormIterator' => $orm->getIterator(), 'id' => 'roomId', 'name' => 'displayName');
                             } else {
                                 if ($reportFilter->type == ReportBase::FILTER_TYPE_LIST_BUILDING_PREF || $reportFilter->type == ReportBase::FILTER_TYPE_LIST_ROOM_PREF || $reportFilter->type == ReportBase::FILTER_TYPE_LIST_PROVIDER_PREF) {
                                     $room = User::myPreferencesLocation();
                                     $practiceId = (int) $room->building->practiceId;
                                     $buildingId = (int) $room->buildingId;
                                     if ($reportFilter->type == ReportBase::FILTER_TYPE_LIST_BUILDING_PREF) {
                                         $orm = new Building();
                                         $orm->practiceId = $practiceId;
                                         $list = array('ormIterator' => $orm->getIteratorByPracticeId(), 'id' => 'buildingId', 'name' => 'displayName');
                                     } else {
                                         if ($reportFilter->type == ReportBase::FILTER_TYPE_LIST_ROOM_PREF) {
                                             $orm = new Room();
                                             $orm->buildingId = $buildingId;
                                             $list = array('ormIterator' => $orm->getIteratorByBuildingId(), 'id' => 'roomId', 'name' => 'displayName');
                                         } else {
                                             $orm = new Provider();
                                             $list = array('ormIterator' => $orm->getIteratorByPracticeId($practiceId), 'id' => 'personId', 'name' => 'displayName');
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         if ($list !== null) {
             $filter['lists'] = array();
             foreach ($list['ormIterator'] as $row) {
                 $filter['lists'][] = array('id' => $row->{$list['id']}, 'name' => htmlspecialchars($row->{$list['name']}));
             }
         }
         $data['filters'][] = $filter;
     }
     $reportView = new ReportView();
     $filters = array('reportBaseId' => $reportBase->reportBaseId, 'active' => 1);
     $reportViewIterator = $reportView->getIteratorByFilters($filters);
     foreach ($reportViewIterator as $view) {
         $row = array();
         $row['id'] = $view->reportViewId;
         $row['data'] = array();
         $row['data'][] = $view->displayName;
         $row['data'][] = $view->runQueriesImmediately;
         $row['data'][] = strlen($view->showResultsIn) > 0 ? $view->showResultsIn : 'grid';
         $data['views'][] = $row;
     }
     $this->view->filterTypes = ReportBase::getFilterTypes();
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct($data);
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:98,代码来源:ReportsController.php

示例7: getArray

 public static function getArray($key = "person_id", $value = "optionName")
 {
     $iter = Provider::getIter();
     return $iter->toArray($key, $value);
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:5,代码来源:Provider.php

示例8: forwardAlertAction

 public function forwardAlertAction()
 {
     $alertId = (int) $this->_getParam('alertId');
     $alert = new GeneralAlert();
     $alert->generalAlertId = $alertId;
     $alert->populate();
     $this->_form = new WebVista_Form(array('name' => 'forwardAlert'));
     $this->_form->setAction(Zend_Registry::get('baseUrl') . 'general-alerts.raw/process-forward-alert');
     $this->_form->loadORM($alert, 'forwardAlert');
     $this->_form->setWindow('windowForwardAlertId');
     $this->view->form = $this->_form;
     $provider = new Provider();
     $providerIterator = $provider->getIter();
     $this->view->providers = $providerIterator->toArray('personId', 'displayName');
     $this->view->jsCallback = $this->_getParam('jsCallback');
     $this->render('forward-alert');
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:17,代码来源:GeneralAlertsController.php


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