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


PHP eZContentClass::fetchList方法代码示例

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


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

示例1: attribute

 function attribute($attr)
 {
     switch ($attr) {
         case 'contentclass_list':
             return eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true);
             break;
         case 'contentclassattribute_list':
             //                $postvarname = 'WorkflowEvent' . '_event_ezwaituntildate_' .'class_' . $workflowEvent->attribute( 'id' ); and $http->hasPostVariable( $postvarname )
             if (isset($GLOBALS['eZWaitUntilDateSelectedClass'])) {
                 $classID = $GLOBALS['eZWaitUntilDateSelectedClass'];
             } else {
                 // if nothing was preselected, we will use the first one:
                 // POSSIBLE ENHANCEMENT: in the common case, the contentclass_list fetch will be called twice
                 $classList = eZWaitUntilDateType::attribute('contentclass_list');
                 if (isset($classList[0])) {
                     $classID = $classList[0]->attribute('id');
                 } else {
                     $classID = false;
                 }
             }
             if ($classID) {
                 return eZContentClassAttribute::fetchListByClassID($classID);
             }
             return array();
             break;
         case 'has_class_attributes':
             // for the backward compatibility:
             return 1;
             break;
         default:
             return eZWorkflowEventType::attribute($attr);
     }
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:33,代码来源:ezwaituntildatetype.php

示例2: fetchLatestClassList

 function fetchLatestClassList($offset, $limit)
 {
     $contentClassList = array();
     $limitData = null;
     if ($limit) {
         $limitData = array('offset' => $offset, 'length' => $limit);
     }
     $contentClassList = eZContentClass::fetchList(0, true, false, array('modified' => 'desc'), null, false, $limitData);
     return array('result' => $contentClassList);
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:10,代码来源:ezclassfunctioncollection.php

示例3: fetchMapMarkers

 public static function fetchMapMarkers($parentNodeId, $childrenClassIdentifiers)
 {
     foreach ($childrenClassIdentifiers as $key => $value) {
         if (empty($value)) {
             unset($childrenClassIdentifiers[$key]);
         }
     }
     $sortBy = array('name' => 'asc');
     $result = array();
     if ($parentNode = self::getNode($parentNodeId)) {
         if (!empty($childrenClassIdentifiers)) {
             $childrenClassTypes = (array) eZContentClass::fetchList(0, true, false, null, null, $childrenClassIdentifiers);
         } else {
             $childrenClassTypes = self::getChildrenClasses($parentNodeId);
         }
         // ricavo gli attributi delle classi
         $geoAttributes = array();
         foreach ($childrenClassTypes as $classType) {
             if ($classType instanceof eZContentClass) {
                 $geoAttributes = array_merge($geoAttributes, eZContentClassAttribute::fetchFilteredList(array('contentclass_id' => $classType->attribute('id'), 'version' => $classType->attribute('version'), 'data_type_string' => 'ezgmaplocation')));
             }
         }
         if (count($geoAttributes)) {
             // imposto i filtri di ricerca
             $geoFields = $geoFieldsNames = array();
             foreach ($geoAttributes as $geoAttribute) {
                 if ($geoAttribute instanceof eZContentClassAttribute) {
                     $geoFields[$geoAttribute->attribute('identifier')] = $geoAttribute->attribute('name');
                     $geoFieldsNames[] = "subattr_{$geoAttribute->attribute('identifier')}___coordinates____gpt";
                 }
             }
             $childrenParameters = array('SearchSubTreeArray' => array($parentNode->attribute('node_id')), 'Filter' => array('-meta_id_si:' . $parentNode->attribute('contentobject_id')), 'SearchLimit' => 1000, 'AsObjects' => false, 'SortBy' => $sortBy, 'FieldsToReturn' => $geoFieldsNames);
             // cerco i figli
             $solr = new OCSolr();
             $children = $solr->search('', $childrenParameters);
             if ($children['SearchCount'] > 0) {
                 foreach ($children['SearchResult'] as $item) {
                     foreach ($geoFieldsNames as $geoFieldsName) {
                         @(list($longitude, $latitude) = explode(',', $item['fields'][$geoFieldsName][0]));
                         if (intval($latitude) > 0 && intval($longitude) > 0) {
                             $href = isset($item['main_url_alias']) ? $item['main_url_alias'] : $item['main_url_alias_ms'];
                             eZURI::transformURI($href, false, 'full');
                             $popup = isset($item['name']) ? $item['name'] : $item['name_t'];
                             $id = isset($item['id_si']) ? $item['id_si'] : $item['id'];
                             $result[] = array('id' => $id, 'type' => null, 'lat' => floatval($latitude), 'lon' => floatval($longitude), 'lng' => floatval($longitude), 'popupMsg' => $popup, 'title' => $popup, 'description' => "<h3><a href='{$href}'>{$popup}</a></h3>", 'urlAlias' => $href, 'objectID' => $id);
                         }
                     }
                 }
             }
         }
     }
     return array('result' => $result);
 }
开发者ID:OpencontentCoop,项目名称:ocbootstrap,代码行数:53,代码来源:ocbtoolsfunctioncollection.php

示例4: getAllClassesXML

 public static function getAllClassesXML()
 {
     $dom = new DOMDocument('1.0', 'utf-8');
     $dom->formatOutput = true;
     $root = $dom->createElement('classes');
     $dom->appendChild($root);
     $classes = eZContentClass::fetchList();
     foreach ($classes as $class) {
         $classNode = eZContentClassPackageHandler::classDOMTree($class);
         $classNode = $dom->importNode($classNode, true);
         $root->appendChild($classNode);
     }
     return $dom;
 }
开发者ID:nxc,项目名称:nxc_content_class_diff,代码行数:14,代码来源:helper.php

示例5: array

$subTreeArray = array();
if ($http->hasVariable('SubTreeArray')) {
    if (is_array($http->variable('SubTreeArray'))) {
        $subTreeList = $http->variable('SubTreeArray');
    } else {
        $subTreeList = array($http->variable('SubTreeArray'));
    }
    foreach ($subTreeList as $subTreeItem) {
        // as form input is generally a string, is_int cannot be used for checking the value type
        if (is_numeric($subTreeItem) && $subTreeItem > 0) {
            $subTreeArray[] = $subTreeItem;
        }
    }
}
$Module->setTitle("Search for: {$searchText}");
$classArray = eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true, false, array('name' => 'asc'));
$sectionArray = eZSection::fetchList();
$searchArray = eZSearch::buildSearchArray();
if ($useSearchCode) {
    $searchResult = eZSearch::search($searchText, array('SearchSectionID' => $searchSectionID, 'SearchContentClassID' => $searchContentClassID, 'SearchContentClassAttributeID' => $searchContentClassAttributeID, 'SearchSubTreeArray' => $subTreeArray, 'SearchDate' => $searchDate, 'SearchTimestamp' => $searchTimestamp, 'SearchLimit' => $pageLimit, 'SearchOffset' => $Offset), $searchArray);
    if (strlen(trim($searchText)) == 0 && count($searchArray) > 0) {
        $searchText = 'search by additional parameter';
    }
}
$viewParameters = array('offset' => $Offset);
$searchData = false;
$tpl->setVariable("search_data", $searchData);
$tpl->setVariable('search_contentclass_id', $searchContentClassID);
$tpl->setVariable('search_contentclass_attribute_id', $searchContentClassAttributeID);
$tpl->setVariable('search_section_id', $searchSectionID);
$tpl->setVariable('search_date', $searchDate);
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:31,代码来源:advancedsearch.php

示例6: canAssignSectionToClassList

 function canAssignSectionToClassList($checkSectionID)
 {
     $access = $this->hasAccessTo('section', 'assign');
     if ($access['accessWord'] == 'yes') {
         return array('*');
     } else {
         if ($access['accessWord'] == 'limited') {
             $allowedClassList = array();
             foreach ($access['policies'] as $policy) {
                 if (!isset($policy['NewSection']) or in_array($checkSectionID, $policy['NewSection'])) {
                     if (isset($policy['Class'])) {
                         $allowedClassList = array_merge($allowedClassList, $policy['Class']);
                     } else {
                         return array('*');
                     }
                 }
             }
             if (!empty($allowedClassList)) {
                 // Now we are trying to fetch classes by collected ids list to return
                 // class list consisting of existing classes's identifiers only.
                 $allowedClassList = array_unique($allowedClassList);
                 $classList = eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, false, false, null, null, $allowedClassList);
                 if (is_array($classList) && !empty($classList)) {
                     $classIdentifierList = array();
                     foreach ($classList as $class) {
                         $classIdentifierList[] = $class['identifier'];
                     }
                     return $classIdentifierList;
                 }
             }
         }
     }
     return array();
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:34,代码来源:ezuser.php

示例7: array

                $ruleValue->store();
            }
            $discountRule->setAttribute( 'limitation', false );
        }
    }

    $discountRule->store();
    $db->commit();

    // we changed prices => remove content cache
    eZContentCacheManager::clearAllContentCache();

    return $module->redirectTo( $module->functionURI( 'discountgroupview' ) . '/' . $discountGroupID );
}

$classList = eZContentClass::fetchList();
$productClassList = array();
foreach ( $classList as $class )
{
    if ( eZShopFunctions::isProductClass( $class ) )
        $productClassList[] = $class;
}

$sectionList = eZSection::fetchList();

$tpl = eZTemplate::factory();

$tpl->setVariable( 'module', $module );
$tpl->setVariable( 'discountgroup_id', $discountGroupID );
$tpl->setVariable( 'discountrule', $discountRule );
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:30,代码来源:discountruleedit.php

示例8: removeTemporary

 static function removeTemporary()
 {
     $version = eZContentClass::VERSION_STATUS_TEMPORARY;
     $temporaryClasses = eZContentClass::fetchList($version, true);
     $db = eZDB::instance();
     $db->begin();
     foreach ($temporaryClasses as $class) {
         $class->remove(true, $version);
     }
     eZPersistentObject::removeObject(eZContentClassAttribute::definition(), array('version' => $version));
     $db->commit();
 }
开发者ID:nlenardou,项目名称:ezpublish,代码行数:12,代码来源:ezcontentclass.php

示例9: initializePackage


//.........这里部分代码省略.........
         // Fix always available
         $updateSql = "UPDATE ezcontentobject_name\nSET\nlanguage_id=language_id+1\nWHERE\ncontentobject_id {$inSql}";
         $db->query($updateSql);
         // attributes
         $updateSql = "UPDATE ezcontentobject_attribute\nSET\nlanguage_code='{$primaryLanguageLocaleCode}',\nlanguage_id={$primaryLanguageID}\nWHERE\nlanguage_code='eng-GB'";
         $db->query($updateSql);
         // Fix always available
         $updateSql = "UPDATE ezcontentobject_attribute\nSET\nlanguage_id=language_id+1\nWHERE\ncontentobject_id {$inSql}";
         $db->query($updateSql);
         // version
         $updateSql = "UPDATE ezcontentobject_version\nSET\ninitial_language_id={$primaryLanguageID},\nlanguage_mask={$primaryLanguageID}\nWHERE\ninitial_language_id={$engLanguageID}";
         $db->query($updateSql);
         // Fix always available
         $updateSql = "UPDATE ezcontentobject_version\nSET\nlanguage_mask=language_mask+1\nWHERE\ncontentobject_id {$inSql}";
         $db->query($updateSql);
         // object
         $updateSql = "UPDATE ezcontentobject\nSET\ninitial_language_id={$primaryLanguageID},\nlanguage_mask={$primaryLanguageID}\nWHERE\ninitial_language_id={$engLanguageID}";
         $db->query($updateSql);
         // Fix always available
         $updateSql = "UPDATE ezcontentobject\nSET\nlanguage_mask=language_mask+1\nWHERE\nid {$inSql}";
         $db->query($updateSql);
         // content object state groups & states
         $mask = $primaryLanguageID | 1;
         $db->query("UPDATE ezcobj_state_group\n                         SET language_mask = {$mask}, default_language_id = {$primaryLanguageID}\n                         WHERE default_language_id = {$engLanguageID}");
         $db->query("UPDATE ezcobj_state\n                         SET language_mask = {$mask}, default_language_id = {$primaryLanguageID}\n                         WHERE default_language_id = {$engLanguageID}");
         $db->query("UPDATE ezcobj_state_group_language\n                         SET language_id = {$primaryLanguageID}\n                         WHERE language_id = {$engLanguageID}");
         $db->query("UPDATE ezcobj_state_language\n                         SET language_id = {$primaryLanguageID}\n                         WHERE language_id = {$engLanguageID}");
         // ezcontentclass_name
         $updateSql = "UPDATE ezcontentclass_name\nSET\nlanguage_locale='{$primaryLanguageLocaleCode}'\nWHERE\nlanguage_locale='eng-GB'";
         $db->query($updateSql);
         // use high-level api, because it's impossible to update serialized names with direct sqls.
         // use direct access to 'NameList' to avoid unnecessary sql-requests and because
         // we do 'replacement' of existing language(with some 'id') with another language code.
         $contentClassList = eZContentClass::fetchList();
         foreach ($contentClassList as $contentClass) {
             $classAttributes = $contentClass->fetchAttributes();
             foreach ($classAttributes as $classAttribute) {
                 $classAttribute->NameList->setName($classAttribute->NameList->name('eng-GB'), $primaryLanguageLocaleCode);
                 $classAttribute->NameList->setAlwaysAvailableLanguage($primaryLanguageLocaleCode);
                 $classAttribute->NameList->removeName('eng-GB');
                 $classAttribute->store();
             }
             $contentClass->NameList->setName($contentClass->NameList->name('eng-GB'), $primaryLanguageLocaleCode);
             $contentClass->NameList->setAlwaysAvailableLanguage($primaryLanguageLocaleCode);
             $contentClass->NameList->removeName('eng-GB');
             $contentClass->NameList->setHasDirtyData(false);
             // to not update 'ezcontentclass_name', because we've already updated it.
             $contentClass->store();
         }
     }
     // Setup all languages
     foreach ($allLanguages as $languageObject) {
         $primaryLanguageObj = eZContentLanguage::fetchByLocale($languageObject->localeCode());
         // Add it if it is missing (most likely)
         if (!$primaryLanguageObj) {
             $primaryLanguageObj = eZContentLanguage::addLanguage($languageObject->localeCode(), $languageObject->internationalLanguageName());
         }
     }
     eZContentLanguage::expireCache();
     // Make sure priority list is changed to the new chosen languages
     eZContentLanguage::setPrioritizedLanguages($prioritizedLanguages);
     if ($siteType['existing_database'] != eZStepInstaller::DB_DATA_KEEP) {
         $user = eZUser::instance(14);
         // Must be initialized to make node assignments work correctly
         if (!is_object($user)) {
             $resultArray['errors'][] = array('code' => 'EZSW-020', 'text' => "Could not fetch administrator user object");
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:67,代码来源:ezstep_create_sites.php

示例10: productClassList

 static function productClassList()
 {
     $productClassList = array();
     $classList = eZContentClass::fetchList();
     foreach ($classList as $class) {
         if (eZShopFunctions::isProductClass($class)) {
             $productClassList[] = $class;
         }
     }
     return $productClassList;
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:11,代码来源:ezshopfunctions.php

示例11: attribute

 function attribute($attr)
 {
     switch ($attr) {
         case 'sections':
             $sections = eZSection::fetchList(false);
             foreach ($sections as $key => $section) {
                 $sections[$key]['Name'] = $section['name'];
                 $sections[$key]['value'] = $section['id'];
             }
             return $sections;
             break;
         case 'languages':
             return eZContentLanguage::fetchList();
             break;
         case 'usergroups':
             $groups = eZPersistentObject::fetchObjectList(eZContentObject::definition(), array('id', 'name'), array('contentclass_id' => 3, 'status' => eZContentObject::STATUS_PUBLISHED), null, null, false);
             foreach ($groups as $key => $group) {
                 $groups[$key]['Name'] = $group['name'];
                 $groups[$key]['value'] = $group['id'];
             }
             return $groups;
             break;
         case 'contentclass_list':
             $classes = eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true, false, array('name' => 'asc'));
             $classList = array();
             for ($i = 0; $i < count($classes); $i++) {
                 $classList[$i]['Name'] = $classes[$i]->attribute('name');
                 $classList[$i]['value'] = $classes[$i]->attribute('id');
             }
             return $classList;
             break;
         case 'workflow_list':
             $workflows = eZWorkflow::fetchList();
             $workflowList = array();
             for ($i = 0; $i < count($workflows); $i++) {
                 $workflowList[$i]['Name'] = $workflows[$i]->attribute('name');
                 $workflowList[$i]['value'] = $workflows[$i]->attribute('id');
             }
             return $workflowList;
             break;
     }
     return eZWorkflowEventType::attribute($attr);
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:43,代码来源:ezmultiplexertype.php

示例12: updateClass

        $params['database'] = $dbName;
    }
    $db = eZDB::instance($dbImpl, $params, true);
    eZDB::setInstance($db);
}
$db->setIsSQLOutputEnabled((bool) $options['sql']);
// Log in admin user
$user = eZUser::fetchByName(isset($options['admin-user']) ? $options['admin-user'] : 'admin');
if ($user) {
    eZUser::setCurrentlyLoggedInUser($user, $user->attribute('id'));
} else {
    $cli->error('Could not fetch admin user object');
    $script->shutdown(1);
    return;
}
// Take care of script monitoring
$scheduledScript = false;
if (isset($options['scriptid'])) {
    $scheduledScript = eZScheduledScript::fetch($options['scriptid']);
}
// Do the update
if (isset($options['classid'])) {
    updateClass($options['classid'], $scheduledScript);
} else {
    $cli->notice('The classid parameter was not given, will check all classes.');
    foreach (eZContentClass::fetchList(eZContentClass::VERSION_STATUS_MODIFIED, false) as $class) {
        $cli->output('Checking class with ID: ' . $class['id']);
        updateClass($class['id'], $scheduledScript);
    }
}
$script->shutdown();
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:syncobjectattributes.php

示例13: attribute

 function attribute($attr)
 {
     switch ($attr) {
         case 'contentclass_list':
             return eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true);
             break;
         default:
             return eZWorkflowEventType::attribute($attr);
     }
 }
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:10,代码来源:multipublishtype.php

示例14: fetchContentClasses

 public static function fetchContentClasses()
 {
     return eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true, false, array('name' => false));
 }
开发者ID:nxc,项目名称:nxc_import,代码行数:4,代码来源:csv_import_config.php


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