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


PHP eZSection::fetchFilteredList方法代码示例

本文整理汇总了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;
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:14,代码来源:ezcreatesection.php

示例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;
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:31,代码来源:updatesectionidentifier.php

示例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;
开发者ID:runelangseid,项目名称:ezpublish,代码行数:31,代码来源:edit.php

示例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;
    }
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:20,代码来源:ezcontentobject.php

示例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}'");
            }
        }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:31,代码来源:updatesectionidentifier.php


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