本文整理汇总了PHP中eZContentObject::recursionProtect方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObject::recursionProtect方法的具体用法?PHP eZContentObject::recursionProtect怎么用?PHP eZContentObject::recursionProtect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentObject
的用法示例。
在下文中一共展示了eZContentObject::recursionProtect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBaseList
/**
* Get ezfSolrDocumentFieldBase instances for all attributes of specified eZContentObjectVersion
*
* @param eZContentObjectVersion Instance of eZContentObjectVersion to fetch attributes from.
*
* @return array List of ezfSolrDocumentFieldBase instances.
*/
function getBaseList( eZContentObjectVersion $objectVersion )
{
$returnList = array();
// Get ezfSolrDocumentFieldBase instance for all attributes in related object
if ( eZContentObject::recursionProtect( $this->ContentObjectAttribute->attribute( 'contentobject_id' ) ) )
{
foreach ( $objectVersion->contentObjectAttributes( $this->ContentObjectAttribute->attribute( 'language_code' ) ) as $attribute )
{
if ( $attribute->attribute( 'contentclass_attribute' )->attribute( 'is_searchable' ) )
{
$returnList[] = ezfSolrDocumentFieldBase::getInstance( $attribute );
}
}
}
return $returnList;
}
示例2: metaData
function metaData($contentObjectAttribute)
{
$object = $this->objectAttributeContent($contentObjectAttribute);
if ($object) {
if (eZContentObject::recursionProtect($object->attribute('id'))) {
// Does the related object exist in the same language as the current content attribute ?
if (in_array($contentObjectAttribute->attribute('language_code'), $object->attribute('current')->translationList(false, false))) {
$attributes = $object->attribute('current')->contentObjectAttributes($contentObjectAttribute->attribute('language_code'));
} else {
$attributes = $object->contentObjectAttributes();
}
return eZContentObjectAttribute::metaDataArray($attributes);
} else {
return array();
}
}
return false;
}
示例3: metaData
function metaData($contentObjectAttribute)
{
$metaDataArray = $attributes = array();
$content = $contentObjectAttribute->content();
$language = $contentObjectAttribute->attribute('language_code');
foreach ($content['relation_list'] as $relationItem) {
$subObjectID = $relationItem['contentobject_id'];
if (!$subObjectID) {
continue;
}
if (isset($content['temp'])) {
$attributes = $content['temp'][$subObjectID]['attributes'];
} else {
$subObjectVersion = $relationItem['contentobject_version'];
$object = eZContentObject::fetch($subObjectID);
if (eZContentObject::recursionProtect($subObjectID)) {
if (!$object) {
continue;
}
$attributes = $object->contentObjectAttributes(true, $subObjectVersion, $language);
}
}
$attributeMetaDataArray = eZContentObjectAttribute::metaDataArray($attributes);
$metaDataArray = array_merge($metaDataArray, $attributeMetaDataArray);
}
return $metaDataArray;
}
示例4: metaData
function metaData($contentObjectAttribute)
{
$metaDataArray = $attributes = array();
$content = $contentObjectAttribute->content();
$language = $contentObjectAttribute->attribute('language_code');
foreach ($content['relation_list'] as $relationItem) {
$subObjectID = $relationItem['contentobject_id'];
if (!$subObjectID) {
continue;
}
if (isset($content['temp'])) {
$attributes = $content['temp'][$subObjectID]['attributes'];
} else {
$subObjectVersionNum = $relationItem['contentobject_version'];
$subObject = eZContentObject::fetch($subObjectID);
// Using last version of object (version inside xml data is the original version)
$subCurrentVersionObject = $subObject->currentVersion();
if ($subCurrentVersionObject instanceof eZContentObjectVersion) {
$subObjectVersionNum = $subCurrentVersionObject->attribute('version');
}
if (eZContentObject::recursionProtect($subObjectID)) {
if (!$subObject) {
continue;
}
$attributes = $subObject->contentObjectAttributes(true, $subObjectVersionNum, $language);
}
}
$attributeMetaDataArray = eZContentObjectAttribute::metaDataArray($attributes);
$metaDataArray = array_merge($metaDataArray, $attributeMetaDataArray);
}
return $metaDataArray;
}