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


PHP eZContentObjectTreeNode::object方法代码示例

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


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

示例1: fromNode

 /**
  * Instanciates an ezpContent from an eZContentObjectTreeNode
  * @param eZContentObjectTreeNode $node
  * @return ezpContent
  */
 public static function fromNode(eZContentObjectTreeNode $node, $checkAccess = true)
 {
     $object = $node->object();
     if ($checkAccess && !$object->attribute('can_read')) {
         throw new ezpContentAccessDeniedException($object->attribute('id'));
     }
     $content = new ezpContent();
     $content->fields = ezpContentFieldSet::fromContentObject($object);
     $content->object = $object;
     $content->locations = ezpContentLocation::fromNode($node);
     return $content;
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:17,代码来源:content.php

示例2: sortByPrority

 /**
  * @param eZContentObjectTreeNode $a
  * @param eZContentObjectTreeNode $b
  * @return int
  */
 public static function sortByPrority(eZContentObjectTreeNode $a, eZContentObjectTreeNode $b)
 {
     $ma = $a->isMain() ? $a : $a->object()->mainNode();
     $mb = $b->isMain() ? $b : $b->object()->mainNode();
     
     if ( $ma->object()->mainNode()->attribute('priority') == $mb->attribute('priority') )
     {
         return 0;
     }
     return ( $ma->attribute('priority') > $mb->attribute('priority') ) ? 1 : -1;
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:16,代码来源:merckmanualfunctioncollection.php

示例3: fromNode

 /**
  * Initializes an object from a node
  * @param eZContentObjectTreeNode $node
  *
  * @return SQLIContent
  */
 public static function fromNode(eZContentObjectTreeNode $node)
 {
     $object = $node->object();
     $content = self::fromContentObject($object);
     $content->locations->addLocation(SQLILocation::fromNode($node));
     return $content;
 }
开发者ID:nicolasaguenot,项目名称:sqliimport,代码行数:13,代码来源:sqlicontent.php

示例4: createHTMLObject

/**
 * create HTML eZ Publish object
 * @param eZContentObjectTreeNode $parentNode
 * @param SimpleXMLElement $_item
 */
function createHTMLObject($parentNode, $_item)
{
    try
    {
        //get actual user
        $user = eZUser::currentUser();

        //object parameters
        $params                      = array();
        $params ['class_identifier'] = 'html';
        $params['creator_id']        = $user->attribute('contentobject_id');
        $params['parent_node_id']    = $parentNode->attribute('node_id');
        $params['section_id']        = $parentNode->object()->attribute('section_id');

        //set template attributes
        include_once('kernel/common/template.php');
        $htmlTpl = eZTemplate::factory();
        $htmlTpl->setVariable('title', $_item->title);
        $htmlTpl->setVariable('link', '/congressos-e-eventos?deeplink=' . urlencode($_item->link));
        $htmlTpl->setVariable('description', $_item->description);
        $htmlTpl->setVariable('category', $_item->category);
        $text = $htmlTpl->fetch('design:html/cronview.tpl');

        //attributes to insert
        $attributesData          = array();
        $attributesData['title'] = $_item->title;
        $attributesData['text']  = $text;

        $params['attributes'] = $attributesData;

        //object creation
        eZContentFunctions::createAndPublishObject($params);
    }
    catch (Exception $e)
    {
        $cli = eZCLI::instance();
        $cli->output($e->getMessage());
    }
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:44,代码来源:congressreportrss.php

示例5: getGTMTags

    /**
     * @param eZContentObjectTreeNode $node
     * @return array
     */
    public function getGTMTags( $node )
    {
        if( !($node instanceof eZContentObjectTreeNode) )
            return array();

        /* @type eZContentObjectAttribute[] $dataMap */
        $dataMap = $node->dataMap();
        /* @type eZContentObjectAttribute[] $englishDM */
        $englishDM = $node->object()->fetchDataMap( false, 'eng-GB' );
        $gtmVariables = array();
        
        if ($englishDM['headline'] || $dataMap['headline'])
        {
            $headline = count( $englishDM ) > 0 ? $englishDM['headline']->content() : $dataMap['headline']->content();
            $gtmVariables['contentName'] = addslashes(preg_replace("/[\\n\\r]+/"," ",$headline));
        }
        
        $remoteId = $node->object()->remoteID();
        $clusterIdentifier = ClusterTool::clusterIdentifier();
        
        if($remoteId && $clusterIdentifier)
        {
            $rating = SolrSafeOperatorHelper::getRatings( $remoteId, $clusterIdentifier );
            if ($rating)
            {
                $gtmVariables['contentScore'] = $rating;
            }
        }
        
        if($dataMap['tags'] && $dataMap['tags']->content())
        {
            $gtmVariables['tags'] = implode(",", explode("|", $dataMap['tags']->content()));
        }
        
        if($this->channel){
            
            $gtmVariables['sponsorName'] = '';
            $gtmVariables['sponsorPage'] = false;
            
            $sponsorName = $this->channel->attribute("sponsor");
            
            if ($sponsorName)
            {
                $gtmVariables['sponsorName'] = $sponsorName;
                $gtmVariables['sponsorPage'] = true;
            }
            
            $promoTaxonomy = $this->applicationLocalized()->getCustomParameter( 'PromoTaxonomy' );
            $promoTaxonomy = $promoTaxonomy ? $promoTaxonomy : $this->applicationObject()->getCustomParameter( 'PromoTaxonomy' );
            
            if($promoTaxonomy){
                $taxonomies = $dataMap['serialized_taxonomies']->content();
                
                if(is_array($taxonomies) && count($taxonomies[$promoTaxonomy]) > 0)
                {
                    $contentAreaTags = '';
                    foreach($taxonomies[$promoTaxonomy] as $taxonomy)
                    {
                         $contentAreaTags .= SolrSafeOperatorHelper::translateTaxonomy($taxonomy).",";
                    }
                    $gtmVariables['contentAreaTags'] = $contentAreaTags;
                }
            }
        }

        return $gtmVariables;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:71,代码来源:applicationDefault.php

示例6: addVideo

 function addVideo(eZContentObjectTreeNode $node)
 {
     $ini = eZINI::instance('xrowsitemap.ini');
     $video = new xrowSitemapItemVideo();
     $video->title = $node->attribute('name');
     $video->categories = array($node->attribute('parent')->attribute('name'));
     $object = $node->object();
     $video->view_count = eZViewCounter::fetch($node->attribute('node_id'))->Count;
     $video->publication_date = new DateTime('@' . $object->attribute('published'));
     $dm = $node->attribute('data_map');
     foreach ($dm as $attribute) {
         switch ($attribute->DataTypeString) {
             case 'xrowmetadata':
                 if ($attribute->hasContent()) {
                     $keywordattribute = $attribute->content();
                     $video->tags = array_merge($video->tags, $keywordattribute->keywords);
                 }
                 break;
             case 'ezkeyword':
                 if ($attribute->hasContent()) {
                     $keywordattribute = $attribute->content();
                     $video->tags = array_merge($video->tags, $keywordattribute->KeywordArray);
                 }
                 break;
             case 'ezimage':
                 if ($attribute->hasContent()) {
                     $imagedata = $attribute->content();
                     if ($ini->hasVariable('SitemapSettings', 'ImageAlias')) {
                         $aliasdata = $imagedata->attribute($ini->variable('SitemapSettings', 'ImageAlias'));
                         $video->thumbnail_loc = 'http://' . xrowSitemapTools::domain() . '/' . $aliasdata['url'];
                     } else {
                         $aliasdata = $imagedata->attribute('original');
                         $video->thumbnail_loc = 'http://' . xrowSitemapTools::domain() . '/' . $aliasdata['url'];
                     }
                 }
                 break;
             case 'ezmedia':
                 if ($attribute->hasContent()) {
                     $content = $attribute->content();
                     $uri = "content/download/" . $attribute->attribute('contentobject_id') . '/' . $content->attribute('contentobject_attribute_id') . '/' . $content->attribute('original_filename');
                     $video->content_loc = 'http://' . xrowSitemapTools::domain() . '/' . $uri;
                 }
                 break;
             case 'xrowvideo':
                 if ($attribute->hasContent()) {
                     $content = $attribute->content();
                     $uri = "content/download/" . $content["media"]->attribute->ContentObjectID . '/' . $content["media"]->attribute->ID . '/' . $content["binary"]->OriginalFilename;
                     $video->content_loc = 'http://' . xrowSitemapTools::domain() . '/' . $uri;
                     $video->duration = (int) $content["video"]["duration"];
                 }
                 break;
         }
         switch ($attribute->ContentClassAttributeIdentifier) {
             case 'description':
                 if ($attribute->hasContent()) {
                     $content = $attribute->content();
                     $descriptions = substr(strip_tags($content->ContentObjectAttribute->DataText), 0, 2048);
                     $video->description = $descriptions;
                 }
                 break;
         }
     }
     return $video;
 }
开发者ID:rantoniazzi,项目名称:xrowmetadata,代码行数:64,代码来源:standardplugin.php

示例7: getPublisherFolderPath

    /**
     * 
     * @param eZContentObjectTreeNode $publisherFolderNode
     * @return string
     */
    public static function getPublisherFolderPath ( $publisherFolderNode )
    {
        $publisherFolderObject = $publisherFolderNode->object();
        $matchPath = array();

        if ( !preg_match('#^publisher_folder-(.*)$#', $publisherFolderObject->attribute('remote_id'), $matchPath) )
            return null;
        
        return $matchPath[1];
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:15,代码来源:publisherFolderTool.php

示例8: processSpecificMerckManual

    /**
     * @param eZSolrDoc[] $docList
     * @param eZContentObjectTreeNode $node
     * @param $publisherFolderRelations
     */
    protected function processSpecificMerckManual(&$docList, $node, $dataMap, $publisherFolderRelations)
    {
        /* @var eZContentObjectAttribute[] $datamapDefault */
        $datamapDefault             = $dataMap;
        $taxonomiesAttribute        = $datamapDefault['serialized_taxonomies'];
        $merckManualClusters        = array();

        foreach ( $publisherFolderRelations['clusters'] as $cluster => $applications )
            foreach ( $applications as $application )
                if( $application == MerckManualShowcase::mainApplicationIdentifier() )
                    $merckManualClusters[] = $cluster;

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

            if( isset( $taxonomies['section']) )
            {
                $sections = $taxonomies['section'];

                foreach( $docList as $languageCode => $doc )
                {
                    $datamap = $node->object()->fetchDataMap(false, $languageCode);

                    if( !$datamap )
                        $datamap = $datamapDefault;

                    $customSectionChaptersParts = array(
                        $sections[0],
                        $node->attribute( 'node_id' ),
                        $datamap['headline']->content()
                    );

                    foreach( $merckManualClusters as $cluster )
                    {
                        $doc->addField('attr_custom_section_chapter_' . $cluster . '_s', implode('##', $customSectionChaptersParts));
                    }
                }
                $this->addValueToDoc( $docList, 'subattr_section___source_id____s', $sections, true, true );
            }
        }
        elseif ( !($taxonomiesAttribute instanceof eZContentObjectAttribute) )
        {
            eZLog::write( "Indexation : Article with nodeId {$node->NodeID} doesn't have serialized_taxonomies attribute", 'error.log' );
        }
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:51,代码来源:kezfsolrarticleindex.php


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