本文整理汇总了PHP中org_glizy_ObjectFactory::createModelIterator方法的典型用法代码示例。如果您正苦于以下问题:PHP org_glizy_ObjectFactory::createModelIterator方法的具体用法?PHP org_glizy_ObjectFactory::createModelIterator怎么用?PHP org_glizy_ObjectFactory::createModelIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org_glizy_ObjectFactory
的用法示例。
在下文中一共展示了org_glizy_ObjectFactory::createModelIterator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process_ajax
function process_ajax()
{
$mode = $this->getAttribute('mode');
$q = __Request::get('q');
$result = array();
if ($mode == 'users') {
$it = org_glizy_ObjectFactory::createModelIterator('org.glizycms.userManager.models.UserGroup', 'all');
$it->setOrFilters(array("user_firstName" => $q, "user_lastName" => $q, "user_loginId" => $q));
foreach ($it as $ar) {
$result[] = array('id' => $ar->user_id, 'text' => $ar->user_loginId);
}
} else {
if ($mode == 'groups') {
$it = org_glizy_ObjectFactory::createModelIterator('org.glizycms.userManager.models.UserGroup', 'all', array('filters' => array('usergroup_name' => $q)));
foreach ($it as $ar) {
$result[] = array('id' => $ar->usergroup_id, 'text' => $ar->usergroup_name);
}
} else {
$it = org_glizy_ObjectFactory::createModelIterator('org.glizycms.roleManager.models.Role', 'all', array('filters' => array('role_name' => $q)));
foreach ($it as $ar) {
$result[] = array('id' => $ar->role_id, 'text' => $ar->role_name);
}
}
}
return $result;
}
示例2: searchDocumentsByTerm
public function searchDocumentsByTerm($term, $id, $protocol = '', $filterType = '')
{
$result = array();
if ($protocol && $protocol != $this->protocol) {
return $result;
}
$languageId = $this->editLanguageId;
$it = org_glizy_ObjectFactory::createModelIterator('org.glizycms.core.models.Menu');
if ($term) {
$it->load('autocompletePagePicker', array('search' => '%' . $term . '%', 'languageId' => $languageId, 'menuId' => '', 'pageType' => $filterType));
} else {
if ($id) {
if (!is_numeric($id) && strpos($id, $this->protocol) !== 0) {
return $result;
} elseif (is_string($id)) {
$id = $this->getIdFromLink($id);
}
$it->load('autocompletePagePicker', array('search' => '', 'languageId' => $languageId, 'menuId' => $id));
} else {
return $result;
}
}
foreach ($it as $ar) {
$result[] = array('id' => $this->protocol . $ar->menu_id, 'text' => $ar->menudetail_title, 'path' => ltrim($ar->p1 . '/' . $ar->p2 . '/' . $ar->p3, '/') . '/' . $ar->menudetail_title);
}
return $result;
}
示例3: render_html
function render_html()
{
if (!__Config::get('MULTILANGUAGE_ENABLED')) {
return false;
}
$iterator = org_glizy_ObjectFactory::createModelIterator('org.glizycms.core.models.Language', 'all', array('order' => 'language_order'));
if ($iterator->count() > 1) {
$output = '<ul class="' . $this->getAttribute('cssClass') . '" id="' . $this->getId() . '">';
if ($this->getAttribute('separator') == 'start') {
$output .= '<li class="separator">|</li>';
}
foreach ($iterator as $ar) {
$url = __Link::addParams(array('language' => $ar->language_code));
if ($ar->language_id == $this->_application->getLanguageId()) {
$output .= '<li class="' . $ar->language_code . '">' . org_glizy_helpers_Link::makeSimpleLink(glz_encodeOutput($ar->language_name), $url, '', 'active') . '</li>';
} else {
$output .= '<li class="' . $ar->language_code . '">' . org_glizy_helpers_Link::makeSimpleLink(glz_encodeOutput($ar->language_name), $url) . '</li>';
}
}
if ($this->getAttribute('separator') == 'end') {
$output .= '<li>|</li>';
}
$output .= '</ul>';
$this->addOutputCode($output);
}
}
示例4: addModule
function addModule($moduleId, $permission = array('visible' => 'true'))
{
$it = org_glizy_ObjectFactory::createModelIterator('org.glizycms.roleManager.models.Role');
foreach ($it as $ar) {
$permissions = unserialize($ar->role_permissions);
$permissions[$moduleId] = $permission;
$ar->role_permissions = serialize($permissions);
$ar->save();
}
}
示例5: findTerm
public function findTerm($fieldName, $model, $query, $term, $proxyParams = null)
{
$model = org_glizy_Modules::getModule($proxyParams->moduleId);
$it = org_glizy_ObjectFactory::createModelIterator($model->classPath . '.models.Model')->where('title', '%' . $term . '%', 'ILIKE')->orderBy('title');
$result = array();
foreach ($it as $ar) {
$result[] = array('id' => $ar->getId(), 'text' => $ar->title);
}
return $result;
}
示例6: query
static function query($path)
{
$params =& org_glizy_Registry::_getValuesArray();
$iterator = org_glizy_ObjectFactory::createModelIterator('org.glizy.models.Registry', 'all', array('filters' => array('registry_path' => $path)));
// TODO controlare se ci sono stati errori
$result = array();
foreach ($iterator as $ar) {
$params[$ar->registry_path] = $ar->registry_value;
$result[$ar->registry_path] = $ar->registry_value;
}
return $result;
}
示例7: compileRouting
private function compileRouting()
{
$routing = '';
$it = org_glizy_ObjectFactory::createModelIterator('org.glizycms.speakingUrl.models.SpeakingUrl')->load('all');
foreach ($it as $ar) {
if (isset(self::$modules[$ar->speakingurl_type])) {
$routing .= self::$modules[$ar->speakingurl_type]->compileRouting($ar);
}
}
$routing = '<?xml version="1.0" encoding="utf-8"?><glz:Routing>' . $routing . '</glz:Routing>';
$evt = array('type' => GLZ_EVT_LISTENER_COMPILE_ROUTING, 'data' => $routing);
$this->dispatchEvent($evt);
}
示例8: array
function &loadQuery($queryName = '', $options = array())
{
if (is_null($this->_recordIterator)) {
$this->_recordIterator =& org_glizy_ObjectFactory::createModelIterator($this->getAttribute('recordClassName'));
if ($this->getAttribute('showAll') && method_exists($it, 'showAll')) {
$this->_recordIterator->showAll();
}
}
if (empty($queryName)) {
$queryName = $this->getAttribute('query');
}
$order = $this->getAttribute('order');
if (!empty($order)) {
$options['order'] = array($order => $this->getAttribute('orderModifier'));
}
if ($this->getAttribute('useQueryParams') && isset($options['filters'])) {
$options['params'] = array();
if (count($options['filters'])) {
foreach ($options['filters'] as $k => $v) {
$options['params'][$k] = is_array($v) ? $v[1] : $v;
}
}
unset($options['filters']);
}
if ($this->getAttribute('limit')) {
$options['limit'] = explode(',', $this->getAttribute('limit'));
}
if ($this->getAttribute('filters')) {
$options['filters'] = $this->getAttribute('filters');
}
// TODO
// if ($this->getAttribute('categories')) $options['categories'] = $this->getAttribute('categories');
// TODO
// if ($this->getAttribute('params')) $options['params'] = $this->getAttribute('params');
$it = $this->_recordIterator->load($queryName);
if (!empty($options['filters'])) {
if ($this->getAttribute('queryOperator') === 'OR') {
$it->setOrFilters($options['filters']);
} else {
$it->setFilters($options['filters']);
}
}
if (isset($options['order'])) {
$it->setOrderBy($options['order']);
}
if (isset($options['limit'])) {
$it->limit($options['limit']);
}
// glz_dbdebug(true);
return $it;
}
示例9: getWithName
public function getWithName($fileName, $queryName, $options = array())
{
$data = $this->_cacheObj->get($fileName, $this->group);
if ($data === false) {
$data = array();
$it = org_glizy_ObjectFactory::createModelIterator($this->model, $queryName, $options);
foreach ($it as $ar) {
$data[] = $ar->getValuesAsArray();
}
$this->_cacheObj->save($this->serialize($data), $fileName, $this->group);
} else {
$data = $this->unserialize($data);
}
return new org_glizy_dataAccess_cache_Iterator($data);
}
示例10: process
/**
* Process
*
* @return boolean false if the process is aborted
* @access public
*/
function process()
{
$classPath = $this->getAttribute('recordClassName');
if (is_null($classPath)) {
// TODO
// visualizzare FATAL ERROR
$this->RaiseError("DataProvider: record class don't found", __FUNCTION__, __FILE__, __LINE__, 'verbosedie');
} else {
$this->iterator =& org_glizy_ObjectFactory::createModelIterator($classPath);
if ($this->iterator === false) {
// TODO
// visualizzare FATAL ERROR
$this->RaiseError("DataProvider: record class don't found", __FUNCTION__, __FILE__, __LINE__, 'verbosedie');
}
}
}
示例11: execute
public function execute()
{
if (method_exists($this->view, 'setData')) {
$siteProp = unserialize(org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $this->application->getLanguage(), ''));
$lastUpdate = org_glizy_Registry::get('movio/modules/publishApp/lastUpdate');
$data = new StdClass();
$data->title = $siteProp['title'];
$data->subtitle = $siteProp['subtitle'];
if ($lastUpdate) {
$data->lastUpdate = '<p>' . __T('Last exportation date') . ': ' . date(__T('GLZ_DATETIME_FORMAT') . '</p>', $lastUpdate);
}
$data->isExhibitionActive = 1;
$it = org_glizy_ObjectFactory::createModelIterator('org.glizycms.core.models.Language')->load('getLanguageDictionary');
$this->setComponentsAttribute('languages', 'rows', $it->count());
$this->view->setData($data);
}
}
示例12: login
public function login($loginId, $psw, $remember = false)
{
$this->validateLogin($loginId, $psw);
$this->resetSession();
$it = org_glizy_ObjectFactory::createModelIterator('org.glizy.models.User')->load('login', array('loginId' => $loginId, 'password' => $psw));
if ($it->count()) {
// login success
$this->arUser = $it->current();
if ($this->arUser->user_isActive == 0) {
throw org_glizy_authentication_AuthenticationException::userNotActive();
}
if (__Config::get('ACL_ROLES') && $this->onlyBackendUser) {
$user = array('id' => $this->arUser->user_id, 'firstName' => $this->arUser->user_firstName, 'lastName' => $this->arUser->user_lastName, 'loginId' => $this->arUser->user_loginId, 'email' => $this->arUser->user_email, 'groupId' => $this->arUser->user_FK_usergroup_id, 'backEndAccess' => false);
$user =& org_glizy_ObjectFactory::createObject('org.glizy.application.User', $user);
if (!$user->acl('Home', 'all')) {
org_glizy_Session::destroy();
throw org_glizy_authentication_AuthenticationException::AccessNotAllowed();
}
$backEndAccess = true;
} else {
if ($this->onlyBackendUser && $this->arUser->usergroup_backEndAccess == 0) {
throw org_glizy_authentication_AuthenticationException::AccessNotAllowed();
}
if (count($this->allowGroups) ? !in_array($this->arUser->user_FK_usergroup_id, $this->allowGroups) : false) {
throw org_glizy_authentication_AuthenticationException::AccessNotAllowed();
}
$backEndAccess = $this->arUser->usergroup_backEndAccess;
}
$language = $this->language;
if (!$language) {
$language = __Config::get('DEFAULT_LANGUAGE');
}
$user = array('id' => $this->arUser->user_id, 'firstName' => $this->arUser->user_firstName, 'lastName' => $this->arUser->user_lastName, 'loginId' => $this->arUser->user_loginId, 'email' => $this->arUser->user_email, 'groupId' => $this->arUser->user_FK_usergroup_id, 'backEndAccess' => $backEndAccess, 'language' => $language);
$this->setSession($user);
if ($remember) {
$this->setCookie($loginId, $psw);
}
$evt = array('type' => GLZ_EVT_USERLOGIN, 'data' => $user);
$this->dispatchEvent($evt);
return $user;
} else {
// wrong username or password
throw org_glizy_authentication_AuthenticationException::wrongLoginIdOrPassword();
}
}
示例13: _initSiteMap
function _initSiteMap($forceReload = false)
{
$this->log("initSiteMap", GLZ_LOG_SYSTEM);
$this->siteMap =& org_glizy_ObjectFactory::createObject('org.glizycms.core.application.SiteMapDB');
$this->siteMap->getSiteArray($forceReload);
// controlla se l'utente ha i permessi per modificare la pagina
// per velocizzare vengono precaricate tutte le relazioni in memoria
$this->_aclPage = array();
if (__Config::get('ACL_ENABLED')) {
$this->_aclPage = __Session::get('glizy.aclFront', NULL);
if (is_null($this->_aclPage)) {
$this->_aclPage = array();
$it = org_glizy_ObjectFactory::createModelIterator('org.glizy.models.Join', 'all', array('filters' => array('join_objectName' => 'menus_tbl#rel_aclFront')));
foreach ($it as $arC) {
if (!isset($this->_aclPage[$arC->join_FK_source_id])) {
$this->_aclPage[$arC->join_FK_source_id] = array();
}
$this->_aclPage[$arC->join_FK_source_id][] = $arC->join_FK_dest_id;
}
// scorre tutti i menù per attribuire l'acl ai menù che non ce l'hanno
// ereditandola dal padre
$siteMapIterator =& org_glizy_ObjectFactory::createObject('org.glizy.application.SiteMapIterator', $this->siteMap);
while (!$siteMapIterator->EOF) {
$n = $siteMapIterator->getNode();
$siteMapIterator->moveNext();
if (!isset($this->_aclPage[$n->id])) {
$n2 = $n;
while (true) {
if ($n2->parentId == 0) {
break;
}
$parentNode = $n2->parentNode();
$n2 = $parentNode;
if (isset($this->_aclPage[$parentNode->id])) {
$this->_aclPage[$n->id] = $this->_aclPage[$parentNode->id];
break;
}
}
}
}
__Session::set('glizy.aclFront', $this->_aclPage);
}
}
}
示例14: getWithName
/**
* @param $key
* @param $queryName
* @param array $options
*
* @return org_glizy_dataAccess_cache_Iterator
*/
public function getWithName($key, $queryName, $options = array())
{
$data = $this->redis->get($key);
if ($data == null) {
$data = array();
/** @var org_glizy_dataAccess_cache_Iterator $it */
$it = org_glizy_ObjectFactory::createModelIterator($this->model, $queryName, $options);
/** @var org_glizy_dataAccess_cache_ActiveRecord $ar */
foreach ($it as $ar) {
$data[] = $ar->getValuesAsArray();
}
$this->redis->set($key, $this->serialize($data));
} else {
$data = $this->unserialize($data);
}
if ($this->lifeTime != -1) {
$this->redis->expire($key, $this->lifeTime);
}
return new org_glizy_dataAccess_cache_Iterator($data);
}
示例15: process
function process()
{
$this->_content = array();
$this->_content['label'] = $this->getAttribute('label');
$this->_content['cssClass'] = $this->getAttribute('cssClass');
$this->_content['current'] = '';
$this->_content['records'] = array();
$iterator = org_glizy_ObjectFactory::createModelIterator('org.glizycms.core.models.Language');
$iterator->orderBy('language_order');
if ($iterator->count()) {
$editLanguageId = $this->_application->getEditingLanguageId();
foreach ($iterator as $ar) {
if ($ar->language_id == $editLanguageId) {
$this->_content['current'] = $ar->language_name;
continue;
}
$url = org_glizy_helpers_Link::addParams(array('switchLanguage' => $ar->language_id));
$this->_content['records'][] = org_glizy_helpers_Link::makeSimpleLink(glz_encodeOutput($ar->language_name), $url, $ar->language_name);
}
}
}