本文整理汇总了PHP中eZSection::fetchFilteredList方法的典型用法代码示例。如果您正苦于以下问题:PHP eZSection::fetchFilteredList方法的具体用法?PHP eZSection::fetchFilteredList怎么用?PHP eZSection::fetchFilteredList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZSection
的用法示例。
在下文中一共展示了eZSection::fetchFilteredList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sectionIDbyName
private function sectionIDbyName( $name )
{
$sectionID = false;
$sectionList = eZSection::fetchFilteredList( array( 'name' => $name ), false, false, true );
if( is_array( $sectionList ) && count( $sectionList ) > 0 )
{
$section = $sectionList[0];
if( is_object( $section ) )
{
$sectionID = $section->attribute( 'id' );
}
}
return $sectionID;
}
示例2: array
* @version 2013.11
* @package update
*/
require 'autoload.php';
$script = eZScript::instance(array('description' => 'eZ Publish section identifier update script. ' . 'This script will update existing sections with missing identifiers.', 'use-session' => false, 'use-modules' => false, 'use-extensions' => true));
$script->startup();
$options = $script->getOptions('', '', array('-q' => 'Quiet mode'));
$script->initialize();
$cli = eZCLI::instance();
$trans = eZCharTransform::instance();
// Fetch 50 items per iteration
$limit = 50;
$offset = 0;
do {
// Fetch items with empty identifier
$rows = eZSection::fetchFilteredList(null, $offset, $limit);
if (!$rows) {
break;
}
foreach ($rows as $row) {
if ($row->attribute('identifier') == '') {
// Create a new section identifier with NAME_ID pattern
$name = $row->attribute('name');
$identifier = $trans->transformByGroup($name, 'identifier') . '_' . $row->attribute('id');
// Set new section identifier and store it
$row->setAttribute('identifier', $identifier);
$row->store();
$cli->output("Setting identifier '{$identifier}' for section '{$name}'");
}
}
$offset += $limit;
示例3: eZSection
}
if ($http->hasPostVariable("StoreButton")) {
if ($SectionID == 0) {
$section = new eZSection(array());
}
$section->setAttribute('name', $http->postVariable('Name'));
$sectionIdentifier = trim($http->postVariable('SectionIdentifier'));
$errorMessage = '';
if ($sectionIdentifier === '') {
$errorMessage = ezpI18n::tr('design/admin/section/edit', 'Identifier can not be empty');
} else {
if (preg_match('/(^[^A-Za-z])|\\W/', $sectionIdentifier)) {
$errorMessage = ezpI18n::tr('design/admin/section/edit', 'Identifier should consist of letters, numbers or \'_\' with letter prefix.');
} else {
$conditions = array('identifier' => $sectionIdentifier, 'id' => array('!=', $SectionID));
$existingSection = eZSection::fetchFilteredList($conditions);
if (count($existingSection) > 0) {
$errorMessage = ezpI18n::tr('design/admin/section/edit', 'The identifier has been used in another section.');
}
}
}
$section->setAttribute('identifier', $sectionIdentifier);
$section->setAttribute('navigation_part_identifier', $http->postVariable('NavigationPartIdentifier'));
if ($http->hasPostVariable('Locale')) {
$section->setAttribute('locale', $http->postVariable('Locale'));
}
if ($errorMessage === '') {
$section->store();
eZContentCacheManager::clearContentCacheIfNeededBySectionID($section->attribute('id'));
$Module->redirectTo($Module->functionURI('list'));
return;
示例4: allowedAssignSectionList
/**
* @return eZSection[]|null
*/
function allowedAssignSectionList()
{
$currentUser = eZUser::currentUser();
$sectionIDList = $currentUser->canAssignToObjectSectionList( $this );
$sectionList = array();
if ( in_array( '*', $sectionIDList ) )
{
$sectionList = eZSection::fetchList( false );
}
else
{
$sectionIDList[] = $this->attribute( 'section_id' );
$sectionList = eZSection::fetchFilteredList( array( 'id' => array( $sectionIDList ) ), false, false, false );
}
return $sectionList;
}
示例5: array
* @package update
*/
require 'autoload.php';
$script = eZScript::instance(array('description' => 'eZ Publish section identifier update script. ' . 'This script will update existing sections with missing identifiers.', 'use-session' => false, 'use-modules' => false, 'use-extension' => false));
$script->startup();
$options = $script->getOptions('', '', array('-q' => 'Quiet mode'));
$script->initialize();
$isQuiet = $script->isQuiet();
$cli = eZCLI::instance();
$trans = eZCharTransform::instance();
// Fetch 50 items per iteration
$limit = 50;
$offset = 0;
do {
// Fetch items with empty identifier
$rows = eZSection::fetchFilteredList(array('identifier' => ''), $offset, $limit);
if (!$rows) {
break;
}
foreach ($rows as $row) {
if ($row->attribute('identifier') == '') {
// Create a new section identifier with NAME_ID pattern
$name = $row->attribute('name');
$identifier = $trans->transformByGroup($name, 'identifier') . '_' . $row->attribute('id');
// Set new section identifier and store it
$row->setAttribute('identifier', $identifier);
$row->store();
if (!$isQuiet) {
$cli->output("Setting identifier '{$identifier}' for section '{$name}'");
}
}