本文整理汇总了PHP中Handler::getIterator方法的典型用法代码示例。如果您正苦于以下问题:PHP Handler::getIterator方法的具体用法?PHP Handler::getIterator怎么用?PHP Handler::getIterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Handler
的用法示例。
在下文中一共展示了Handler::getIterator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _populateHandlers
protected function _populateHandlers()
{
$this->_handlers = array();
try {
$cacheCodeObjects = Zend_Registry::get('cacheCodeObjects');
} catch (Exception $e) {
$cacheCodeObjects = array();
}
$handler = new Handler();
$db = Zend_Registry::get('dbAdapter');
$dbSelect = $db->select()->from($handler->_table)->where('handlerType = ' . Handler::HANDLER_TYPE_HL7)->where('active = 1');
$handlerIterator = $handler->getIterator($dbSelect);
foreach ($handlerIterator as $item) {
$conditionObject = $item->conditionObject;
if (!strlen($conditionObject) > 0) {
$conditionObject = $item->generateDefaultConditionObject();
}
$md5 = md5($conditionObject);
if (!in_array($md5, $cacheCodeObjects)) {
$cacheCodeObjects[] = $md5;
eval($conditionObject);
// TODO: needs to be validated
}
$this->_handlers[] = $item;
}
Zend_Registry::set('cacheCodeObjects', $cacheCodeObjects);
}
示例2: _populateHandlers
protected function _populateHandlers()
{
$this->_handlers = array();
try {
$cacheCodeObjects = Zend_Registry::get('cacheCodeObjects');
} catch (Exception $e) {
$cacheCodeObjects = array();
}
$handler = new Handler();
$db = Zend_Registry::get('dbAdapter');
$dbSelect = $db->select()->from($handler->_table)->where('handlerType = ' . Handler::HANDLER_TYPE_HL7)->where('active = 1');
$handlerIterator = $handler->getIterator($dbSelect);
foreach ($handlerIterator as $item) {
$classes = array();
$conditionObject = $item->conditionObject;
if (!strlen($conditionObject) > 0) {
$conditionObject = $item->generateDefaultConditionObject();
}
$classConditionHandler = $item->normalizedName . 'ConditionHandler';
$classDatasource = $item->dataIntegrationDatasource->normalizedName . 'DataIntegrationDatasource';
$classDestination = $item->dataIntegrationDestination->normalizedName . 'DataIntegrationDestination';
$classAction = $item->dataIntegrationAction->normalizedName . 'DataIntegrationAction';
if (!class_exists($classConditionHandler) && strlen($conditionObject) > 0) {
$classes[] = $conditionObject;
}
if (!class_exists($classDatasource) && strlen($item->dataIntegrationDatasource->datasource) > 0) {
$classes[] = $item->dataIntegrationDatasource->datasource;
}
if (!class_exists($classDestination) && strlen($item->dataIntegrationDestination->connectInfo) > 0) {
$classes[] = $item->dataIntegrationDestination->connectInfo;
}
if (!class_exists($classAction) && strlen($item->dataIntegrationAction->action) > 0) {
$classes[] = $item->dataIntegrationAction->action;
}
foreach ($classes as $class) {
eval($class);
// TODO: needs to be validated
}
$this->_handlers[] = $item;
}
Zend_Registry::set('cacheCodeObjects', $cacheCodeObjects);
}
示例3: listAction
public function listAction()
{
$type = (int) $this->_getParam('type');
$handler = new Handler($type);
$handlerIterator = $handler->getIterator();
$listConditions = Handler::listConditions();
$rows = array();
foreach ($handlerIterator as $item) {
$condition = $this->_customName;
if (isset($listConditions[$item->condition]) && !strlen($item->conditionObject) > 0) {
$condition = $listConditions[$item->condition];
}
$tmp = array();
$tmp['id'] = $item->handlerId;
switch ($type) {
case Handler::HANDLER_TYPE_GA:
// General Alert
// General Alert
case Handler::HANDLER_TYPE_HSA:
// Health Status Alert
$tmp['data'][] = $item->name;
$tmp['data'][] = $condition;
$tmp['data'][] = $item->active;
break;
default:
// HL7
$tmp['data'][] = $item->name;
$tmp['data'][] = $item->direction;
$tmp['data'][] = $condition;
$tmp['data'][] = $item->active;
break;
}
$rows[] = $tmp;
}
$json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
$json->suppressExit = true;
$json->direct(array('rows' => $rows));
}
示例4: hsaSectionJsonAction
public function hsaSectionJsonAction()
{
$hsa = $this->_getParam('hsa');
$enumeration = new Enumeration();
$enumeration->enumerationId = (int) $hsa;
$enumeration->populate();
$enumerationsClosure = new EnumerationsClosure();
$enumerationIterator = $enumerationsClosure->getAllDescendants($enumeration->enumerationId, 1);
$rows = array();
foreach ($enumerationIterator as $enum) {
$tmp = array();
$tmp['id'] = $enum->enumerationId;
$tmp['data'][] = '';
$tmp['data'][] = $enum->name;
$tmp['data'][] = $enum->key;
$rows[] = $tmp;
}
// temporarily set rows to all defined HSA handlers
$rows = array();
$handler = new Handler(Handler::HANDLER_TYPE_HSA);
$handlerIterator = $handler->getIterator();
foreach ($handlerIterator as $row) {
$tmp = array();
$tmp['id'] = $row->handlerId;
$tmp['data'][] = '';
$tmp['data'][] = $row->name;
$tmp['data'][] = $row->timeframe;
$rows[] = $tmp;
}
$json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
$json->suppressExit = true;
$json->direct(array('rows' => $rows), true);
}