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


PHP eZContentClass::definition方法代码示例

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


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

示例1: fetchList

 static function fetchList($version = eZContentClass::VERSION_STATUS_DEFINED, $asObject = true, $user_id = false, $sorts = null, $fields = null, $classFilter = false, $limit = null)
 {
     $conds = array();
     $custom_fields = null;
     $custom_tables = null;
     $custom_conds = null;
     if (is_numeric($version)) {
         $conds["version"] = $version;
     }
     if ($user_id !== false and is_numeric($user_id)) {
         $conds["creator_id"] = $user_id;
     }
     if ($classFilter) {
         $classIDCount = 0;
         $classIdentifierCount = 0;
         $classIDFilter = array();
         $classIdentifierFilter = array();
         foreach ($classFilter as $classType) {
             if (is_numeric($classType)) {
                 $classIDFilter[] = $classType;
                 $classIDCount++;
             } else {
                 $classIdentifierFilter[] = $classType;
                 $classIdentifierCount++;
             }
         }
         if ($classIDCount > 1) {
             $conds['id'] = array($classIDFilter);
         } else {
             if ($classIDCount == 1) {
                 $conds['id'] = $classIDFilter[0];
             }
         }
         if ($classIdentifierCount > 1) {
             $conds['identifier'] = array($classIdentifierFilter);
         } else {
             if ($classIdentifierCount == 1) {
                 $conds['identifier'] = $classIdentifierFilter[0];
             }
         }
     }
     if ($sorts && isset($sorts['name'])) {
         $nameFiler = eZContentClassName::sqlFilter('ezcontentclass');
         $custom_tables = array($nameFiler['from']);
         $custom_conds = "AND " . $nameFiler['where'];
         $custom_fields = array($nameFiler['nameField']);
         $sorts[$nameFiler['orderBy']] = $sorts['name'];
         unset($sorts['name']);
     }
     return eZPersistentObject::fetchObjectList(eZContentClass::definition(), $fields, $conds, $sorts, $limit, $asObject, false, $custom_fields, $custom_tables, $custom_conds);
 }
开发者ID:nlenardou,项目名称:ezpublish,代码行数:51,代码来源:ezcontentclass.php

示例2: foreach

         $key = $attribute->attribute('id');
         if (isset($attributeNames[$key])) {
             $attribute->setName($attributeNames[$key], $EditLanguage);
         }
     }
 }
 if ($http->hasPostVariable('ContentAttribute_description')) {
     $attributeNames = $http->postVariable('ContentAttribute_description');
     foreach ($attributes as $attribute) {
         $key = $attribute->attribute('id');
         if (isset($attributeNames[$key])) {
             $attribute->setDescription($attributeNames[$key], $EditLanguage);
         }
     }
 }
 eZHTTPPersistence::fetch('ContentClass', eZContentClass::definition(), $class, $http, false);
 if ($http->hasPostVariable('ContentClass_name')) {
     $class->setName($http->postVariable('ContentClass_name'), $EditLanguage);
 }
 if ($http->hasPostVariable('ContentClass_description')) {
     $class->setDescription($http->postVariable('ContentClass_description'), $EditLanguage);
 }
 if ($http->hasVariable('ContentClass_is_container_exists')) {
     if ($http->hasVariable('ContentClass_is_container_checked')) {
         $class->setAttribute("is_container", 1);
     } else {
         $class->setAttribute("is_container", 0);
     }
 }
 if ($http->hasVariable('ContentClass_always_available_exists')) {
     if ($http->hasVariable('ContentClass_always_available')) {
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:31,代码来源:edit.php

示例3: getBrowseItems

 /**
  * Returns a struct containing the following values:
  *      - limit the number of element by page
  *      - offset the current offset
  *      - items array, each element contains
  *          - has_child boolean
  *          - can_create boolean
  *          - node eZContentObjectTreeNode
  *      - has_prev boolean, true if there's a previous page
  *      - has_next boolean, true if there's a next page
  *
  * @param eZContentObjectTreeNode $start the node where the browse will start
  * @param eZContentClass $class class of the object to be created
  * @param int $offset
  * @return array
  */
 private static function getBrowseItems( eZContentObjectTreeNode $start, eZContentClass $class, $offset = 0 )
 {
     $result = array(
         'limit' => 10,
         'offset' => $offset,
         'items' => array(),
         'has_prev' => ( $offset != 0 ),
         'has_next' => false
     );
     $containerClasses = eZPersistentObject::fetchObjectList(
         eZContentClass::definition(), null,
         array(
             'version' => eZContentClass::VERSION_STATUS_DEFINED,
             'is_container' => 1
         )
     );
     $classFilterArray = array();
     foreach ( $containerClasses as $c )
     {
         $classFilterArray[] = $c->attribute( 'identifier' );
     }
     $children = $start->subTree(
         array(
             'ClassFilterArray' => $classFilterArray,
             'ClassFilterType' => 'include',
             'Depth' => 1,
             'Limit' => $result['limit'],
             'Offset' => $offset
         )
     );
     $count = $start->subTreeCount(
         array(
             'ClassFilterArray' => $classFilterArray,
             'ClassFilterType' => 'include',
             'Depth' => 1
         )
     );
     if ( $count > ( $offset + $result['limit'] ) )
     {
         $result['has_next'] = true;
     }
     foreach( $children as $node )
     {
         $elt = array();
         $elt['node'] = $node;
         $canCreateClassist = $node->canCreateClassList();
         foreach( $canCreateClassist as $c )
         {
             if ( $c['id'] == $class->attribute( 'id' ) )
             {
                 $elt['can_create'] = true;
                 break;
             }
         }
         if ( !isset( $elt['can_create'] ) )
         {
             $elt['can_create'] = false;
         }
         $childrenContainerCount = $node->subTreeCount(
             array(
                 'ClassFilterArray' => $classFilterArray,
                 'ClassFilterType' => 'include',
                 'Depth' => 1
             )
         );
         $elt['has_child'] = ( $childrenContainerCount > 0 );
         $result['items'][] = $elt;
     }
     return $result;
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:86,代码来源:ezjscserverfunctionsajaxuploader.php

示例4: redirectToContentBrowseModuleView

/**
 * Pass module view default template parameters
 *
 * @param array $parameters Array of parameters. Optional 
 * @param object $module Object of eZModule. Required  
 * @return string String of url to content/browse
 */
function redirectToContentBrowseModuleView($parameters = false, $module)
{
    if ($parameters == false) {
        // Fetch and use parameters from session directly
        $parameters = eZSession::get('bcimagealias_create_parameters', $parameters);
    }
    /**
     * Fetch array of container classes
     */
    $classes = eZPersistentObject::fetchObjectList(eZContentClass::definition(), array('identifier'), array('is_container' => 1), null, null, false);
    // as object
    /**
     * Prepare array of allowed class identifiers based on above fetch results
     */
    $allowedClasses = array();
    foreach ($classes as $class) {
        $allowedClasses[] = $class['identifier'];
    }
    /**
     * Return browse for node selection view limited to allowed classes
     */
    return eZContentBrowse::browse(array('action_name' => 'BCImageAliasCreateAliasesAddNode', 'from_page' => '/bcimagealias/create', 'class_array' => $allowedClasses, 'persistent_data' => array('ParametersSerialized' => serialize($parameters))), $module);
}
开发者ID:philandteds,项目名称:bcimagealias,代码行数:30,代码来源:create.php


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