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


PHP eZContentObject::isObjectRelationTyped方法代码示例

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


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

示例1: relationTypeMask

    /**
     * @param bool $allRelations
     * @return int
     */
    static function relationTypeMask( $allRelations = false )
    {
        $relationTypeMask = eZContentObject::RELATION_COMMON |
                            eZContentObject::RELATION_EMBED;

        if ( eZContentObject::isObjectRelationTyped() )
        {
            $relationTypeMask |= eZContentObject::RELATION_LINK;
        }

        if ( $allRelations )
        {
            $relationTypeMask |= eZContentObject::RELATION_ATTRIBUTE;
        }

        return $relationTypeMask;
    }
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:21,代码来源:ezcontentobject.php

示例2: fetchReverseRelatedObjectsID

 public static function fetchReverseRelatedObjectsID($objectID, $attributeID, $allRelations)
 {
     if (!is_array($allRelations) || $allRelations === array()) {
         $allRelations = array('common', 'xml_embed', 'attribute');
         if (eZContentObject::isObjectRelationTyped()) {
             $allRelations[] = 'xml_link';
         }
     }
     $relatedObjectsTyped = array();
     foreach ($allRelations as $relationType) {
         $relatedObjectsTyped[$relationType] = eZContentFunctionCollection::fetchReverseRelatedObjects($objectID, $attributeID, array($relationType), false, array(), null);
     }
     $relatedObjectsTypedIDArray = array();
     foreach ($relatedObjectsTyped as $relationTypeName => $relatedObjectsByType) {
         $relatedObjectsTypedIDArray[$relationTypeName] = array();
         foreach ($relatedObjectsByType['result'] as $relatedObjectByType) {
             $relatedObjectsTypedIDArray[$relationTypeName][] = $relatedObjectByType->ID;
         }
     }
     return array('result' => $relatedObjectsTypedIDArray);
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:21,代码来源:ezcontentfunctioncollection.php

示例3: handleRelationTemplate

function handleRelationTemplate($module, $class, $object, $version, $contentObjectAttributes, $editVersion, $editLanguage, $tpl)
{
    $relatedObjects = $object->relatedContentObjectArray($editVersion);
    $tpl->setVariable('related_contentobjects', $relatedObjects);
    $relatedObjectsTyped = array();
    $relatedObjectsTyped['common'] = $object->relatedContentObjectArray($editVersion, false, 0, array('AllRelations' => eZContentObject::RELATION_COMMON));
    $relatedObjectsTyped['xml_embed'] = $object->relatedContentObjectArray($editVersion, false, 0, array('AllRelations' => eZContentObject::RELATION_EMBED));
    if (eZContentObject::isObjectRelationTyped()) {
        $relatedObjectsTyped['xml_link'] = $object->relatedContentObjectArray($editVersion, false, 0, array('AllRelations' => eZContentObject::RELATION_LINK));
    }
    $relatedObjectsTypedIDArray = array();
    foreach ($relatedObjectsTyped as $relationTypeName => $relatedObjectsByType) {
        $relatedObjectsTypedIDArray[$relationTypeName] = array();
        foreach ($relatedObjectsByType as $relatedObjectByType) {
            $relatedObjectsTypedIDArray[$relationTypeName][] = $relatedObjectByType->ID;
        }
    }
    unset($relatedObjectsTyped);
    $ini = eZINI::instance('content.ini');
    $groups = $ini->variable('RelationGroupSettings', 'Groups');
    $defaultGroup = $ini->variable('RelationGroupSettings', 'DefaultGroup');
    $groupedRelatedObjects = array();
    $groupClassLists = array();
    $classGroupMap = array();
    foreach ($groups as $groupName) {
        $groupedRelatedObjects[$groupName] = array();
        $setting = strtoupper($groupName[0]) . substr($groupName, 1) . 'ClassList';
        $groupClassLists[$groupName] = $ini->variable('RelationGroupSettings', $setting);
        foreach ($groupClassLists[$groupName] as $classIdentifier) {
            $classGroupMap[$classIdentifier] = $groupName;
        }
    }
    $groupedRelatedObjects[$defaultGroup] = array();
    foreach ($relatedObjects as $relatedObjectKey => $relatedObject) {
        $classIdentifier = $relatedObject->attribute('class_identifier');
        if (isset($classGroupMap[$classIdentifier])) {
            $groupName = $classGroupMap[$classIdentifier];
            $groupedRelatedObjects[$groupName][] = $relatedObjects[$relatedObjectKey];
        } else {
            $groupedRelatedObjects[$defaultGroup][] = $relatedObjects[$relatedObjectKey];
        }
    }
    $tpl->setVariable('related_contentobjects', $relatedObjects);
    $tpl->setVariable('related_contentobjects_id', $relatedObjectsTypedIDArray);
    $tpl->setVariable('grouped_related_contentobjects', $groupedRelatedObjects);
}
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:46,代码来源:relation_edit.php


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