本文整理汇总了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;
}
示例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);
}
示例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);
}