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


PHP eZContentObject::fetchDataMap方法代码示例

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


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

示例1: fetchByObject

 static function fetchByObject(eZContentObject $object)
 {
     $attributes = $object->fetchDataMap();
     foreach ($attributes as $attribute) {
         if ($attribute->DataTypeString == 'xrowmetadata' and $attribute->hasContent()) {
             return $attribute->content();
         }
     }
     return false;
 }
开发者ID:rantoniazzi,项目名称:xrowmetadata,代码行数:10,代码来源:xrowmetadatatools.php

示例2: fromContentObject

 /**
  * Initializes a level one ezpContentFieldSet from an eZContentObject
  * @param eZContentObject $contentObject
  * @return ezpContentFieldSet
  */
 public static function fromContentObject(eZContentObject $contentObject)
 {
     $set = new ezpContentFieldSet();
     $languages = $contentObject->availableLanguages();
     foreach ($languages as $language) {
         $set->childrenFieldSets[$language] = ezpContentFieldSet::fromDataMap($contentObject->fetchDataMap(false, $language));
     }
     // this sequence is REALLY ugly
     reset($languages);
     $set->setActiveLanguage(current($languages));
     return $set;
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:17,代码来源:field_set.php

示例3: addTranslation

 /**
  * Adds a new translation and creates a new dedicated fieldset.
  * If $lang is an invalid locale (ie. malformed or not declared in site.ini/RegionalSettings.Locale), will throw a SQLIContentException
  * @param string $lang Translation code to add, as a locale (xxx-XX)
  * @throws SQLIContentException
  */
 public function addTranslation($lang)
 {
     $language = eZContentLanguage::fetchByLocale($lang, true);
     if (!$language instanceof eZContentLanguage) {
         throw new SQLIContentException("Invalid language '{$lang}'. Must be a valid locale declared in site.ini, RegionalSettings.Locale !");
     }
     $db = eZDB::instance();
     $db->begin();
     $version = $this->getCurrentDraft($lang);
     $versionNumber = $version->attribute('version');
     $objectID = $this->contentObject->attribute('id');
     $translatedDataMap = $this->contentObject->fetchDataMap($versionNumber, $lang);
     // Check if data map exists for this language in the current draft
     // Indeed, several translations can be created for only one publication of an object
     if (!$translatedDataMap) {
         $classAttributes = $this->contentObject->fetchClassAttributes();
         foreach ($classAttributes as $classAttribute) {
             // TODO : Check if attribute is translatable
             $classAttribute->instantiate($objectID, $lang, $versionNumber);
         }
         // Now clears in-memory cache for this datamap (it was fetched once above)
         // Then re-fetch the newly created translated data map
         global $eZContentObjectDataMapCache;
         unset($eZContentObjectDataMapCache[$objectID][$versionNumber][$lang]);
         unset($this->contentObject->ContentObjectAttributes[$versionNumber][$lang]);
         unset($this->contentObject->DataMap[$versionNumber][$lang]);
         $translatedDataMap = $this->contentObject->fetchDataMap($versionNumber, $lang);
     }
     $version->setAttribute('initial_language_id', $language->attribute('id'));
     $version->updateLanguageMask();
     $version->store();
     $db->commit();
     $set = SQLIContentFieldset::fromDataMap($translatedDataMap);
     $set->setLanguage($lang);
     $this->fieldsets[$lang] = $set;
     $this->initIterator();
 }
开发者ID:lolautruche,项目名称:sqliimport,代码行数:43,代码来源:sqlicontentfieldsetholder.php

示例4: modify


//.........这里部分代码省略.........
            
            unset($isHidden);
        }

        ClusterTool::resetCurrentCluster();

        $concernedNode = $contentMainNode;
        $concernedNode->setCurrentLanguage($articleLanguageArray[0]);

        if ( $contentMainNode->attribute('depth') > 4 )
        {
            $concernedNode = $contentMainNode->fetchParent();
            $concernedNode->setCurrentLanguage($articleLanguageArray[0]);
        }

        /* @type $concernedDM eZContentObjectAttribute[] */
        $concernedDM = $concernedNode->dataMap();
        $tags        = $concernedDM['tags'];

        $MerckManualAboutSectionId = eZIni::instance('merck.ini')->variable('MerckManualAboutSettings', 'SectionSourceId');
        $taxonomiesAttribute       = $concernedDM['serialized_taxonomies'];

        if( $taxonomiesAttribute instanceof eZContentObjectAttribute && $taxonomiesAttribute->hasContent() )
        {
            $taxonomies = $taxonomiesAttribute->content();

            foreach( array_keys($publisherFolderRelations['clusters']) as $cluster )
            {
                self::addValueToDoc(
                    $docList,
                    "attr_exclude_from_search_{$cluster}_b",
                    $MerckManualAboutSectionId && in_array($MerckManualAboutSectionId, $taxonomies['section']),
                    false
                );
            }
        }

        if( $tags instanceof eZContentObjectAttribute && $tags->hasContent() )
            self::addValueToDoc( $docList, 'subattr_tags____ms', explode("|", $tags->content()) );

        if ( $isMerckManualShowcase )
            $this->processSpecificMerckManual($docList, $concernedNode, $concernedDM, $publisherFolderRelations);

        foreach ( $publisherFolderRelations['clusters'] as $cluster => $applications )
        {
            ClusterTool::setCurrentCluster( $cluster );

            foreach( $applications as $key => $applicationIdentifier )
            {
                if ( !isset(self::$_applicationIdentifierToId[$applicationIdentifier]) )
                {
                    $applicationLocalized = CacheApplicationTool::buildLocalizedApplicationByIdentifier( $applicationIdentifier );

                    if( !($applicationLocalized instanceof ApplicationLocalized) )
                    {
                        eZDebug::writeError(
                            sprintf('Cluster: %s; Identifier: %s; ObjectId: %s', $cluster, $applicationIdentifier, $contentObject->attribute('id') ),
                            'Error getting application localized' );
                        unset( $publisherFolderRelations['clusters'][$cluster][$key] );
                    }
                    else
                        self::$_applicationIdentifierToId[$applicationIdentifier] = $applicationLocalized->applicationObject()->attribute('id');
                }
            }
        }

        ClusterTool::resetCurrentCluster();
        
        $applicationIds = array();

        foreach ( $publisherFolderRelations['clusters'] as $cluster => $applications )
            foreach( $applications as $applicationIdentifier )
                $applicationIds[] = self::$_applicationIdentifierToId[$applicationIdentifier];

        $uniqueApplicationIds = array_unique($applicationIds);

        foreach( $docList as $languageCode => $doc )
        {
            $dataMap               = $contentObject->fetchDataMap(false, $languageCode);
            $headline              = $dataMap['headline']->content();
            $headlineLowerCase     = mb_strtolower( StringTool::removeAccents($headline, 'utf-8', false), 'utf-8' );
            $unaccentedFirstLetter = mb_substr($headlineLowerCase, 0, 1, 'utf-8');

            $doc->addField( 'attr_headline_first_letter_lc_s', $unaccentedFirstLetter );
            $doc->addField( 'attr_headline_lc_s', $headlineLowerCase );

            foreach( $uniqueApplicationIds as $id )
            {
                $doc->addField( 'subattr_local_application___source_id____s', $id );
            }

            foreach( $publisherFolderRelations['clusters'] as $cluster => $applications )
            {
                foreach( $applications as $applicationIdentifier )
                {
                    $doc->addField('subattr_local_application___source_mixed____s', $cluster . '##unused##' . self::$_applicationIdentifierToId[$applicationIdentifier]);
                }
            }
        }
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:101,代码来源:kezfsolrarticleindex.php


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