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


PHP eZContentObjectAttribute::setContent方法代码示例

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


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

示例1: fromString

    /**
     * Store data from string format as created in  {@link eZGmapLocationType::toString()}
     *
     * @param eZContentObjectAttribute $contentObjectAttribute
     * @param string $string
     */
    function fromString( $contentObjectAttribute, $string )
    {
    	$data = $string !== '' && strpos( $string, '|#' ) !== false ? explode( '|#', $string ) : array( 0 );

    	if ( $data[0] != 0 )
    	{
            $location = new eZGmapLocation( array(
                            'contentobject_attribute_id' => $contentObjectAttribute->attribute('id'),
                            'contentobject_version' => $contentObjectAttribute->attribute('version'),
                            'latitude' => $data[1],
                            'longitude' => $data[2],
                            'address' => $data[3]
                         ));
            $contentObjectAttribute->setContent( $location );
    	}
    	$contentObjectAttribute->setAttribute( 'data_int', $data[0] );
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:23,代码来源:ezgmaplocationtype.php

示例2: customObjectAttributeHTTPAction


//.........这里部分代码省略.........
                                         if ($item->toBeRemoved()) {
                                             $itemToBeRemoved = true;
                                             $itemAdded = $item;
                                         }
                                     }
                                 }
                             }
                             if ($itemAdded || $itemToBeRemoved) {
                                 //if there is same item in history, or item to be removed (in history or valid), set the item in history to be modified
                                 // if item is not to be removed, add to the block since it's not in block ,but in history or valid
                                 if (!$itemToBeRemoved) {
                                     $block->addItem($itemAdded);
                                 }
                                 $itemAdded->setXMLStorable(true);
                                 $itemAdded->setAttribute('node_id', $nodeID);
                                 $itemAdded->setAttribute('priority', $block->getItemCount());
                                 $itemAdded->setAttribute('ts_publication', time());
                                 $itemAdded->setAttribute('ts_visible', '0');
                                 $itemAdded->setAttribute('ts_hidden', '0');
                                 $itemAdded->setAttribute('action', 'modify');
                             } else {
                                 if (!$itemValid) {
                                     //if there is no same item in history and valid, also the item is not to be removed, add new
                                     $item = $block->addItem(new eZPageBlockItem());
                                     $item->setAttribute('object_id', $objectID);
                                     $item->setAttribute('node_id', $nodeID);
                                     $item->setAttribute('priority', $block->getItemCount());
                                     $item->setAttribute('ts_publication', time());
                                     $item->setAttribute('action', 'add');
                                 }
                             }
                         }
                     }
                     $contentObjectAttribute->setContent($page);
                     $contentObjectAttribute->store();
                 }
             }
             break;
         case 'new_item_browse':
             $module = $parameters['module'];
             $redirectionURI = $redirectionURI = $parameters['current-redirection-uri'];
             $page = $contentObjectAttribute->content();
             $zone = $page->getZone($params[1]);
             $block = $zone->getBlock($params[2]);
             $type = $block->attribute('type');
             $blockINI = eZINI::instance('block.ini');
             $classArray = false;
             if ($blockINI->hasVariable($type, 'AllowedClasses')) {
                 $classArray = $blockINI->variable($type, 'AllowedClasses');
             }
             eZContentBrowse::browse(array('class_array' => $classArray, 'action_name' => 'AddNewBlockItem', 'browse_custom_action' => array('name' => 'CustomActionButton[' . $contentObjectAttribute->attribute('id') . '_new_item-' . $params[1] . '-' . $params[2] . ']', 'value' => $contentObjectAttribute->attribute('id')), 'from_page' => $redirectionURI, 'cancel_page' => $redirectionURI, 'persistent_data' => array('HasObjectInput' => 0)), $module);
             break;
         case 'new_source':
             $page = $contentObjectAttribute->content();
             $zone = $page->getZone($params[1]);
             $block = $zone->getBlock($params[2]);
             if ($http->hasPostVariable('SelectedNodeIDArray')) {
                 $selectedNodeIDArray = $http->postVariable('SelectedNodeIDArray');
                 $blockINI = eZINI::instance('block.ini');
                 $fetchParametersSelectionType = $blockINI->variable($block->attribute('type'), 'FetchParametersSelectionType');
                 $fetchParams = unserialize($block->attribute('fetch_params'));
                 if ($fetchParametersSelectionType['Source'] == 'single') {
                     $fetchParams['Source'] = $selectedNodeIDArray[0];
                 } else {
                     $fetchParams['Source'] = $selectedNodeIDArray;
                 }
开发者ID:BGCX067,项目名称:ezpublish-thetechtalent-svn-to-git,代码行数:67,代码来源:ezpagetype.php

示例3: insertSimpleString

 /**
  * @param eZContentObject $object
  * @param eZContentObjectVersion $objectVersion
  * @param string $objectLanguage
  * @param eZContentObjectAttribute $objectAttribute
  * @param string $string
  * @param array $result
  * @return bool
  */
 function insertSimpleString($object, $objectVersion, $objectLanguage, $objectAttribute, $string, &$result)
 {
     $result = array("errors" => array(), "require_storage" => true);
     $objectAttribute->setContent(trim($string));
     $objectAttribute->setAttribute(self::OIB_FIELD, trim($string));
     return true;
 }
开发者ID:netgen,项目名称:ngoib,代码行数:16,代码来源:ngoibtype.php

示例4: fromString

 /**
  * Converts string representation of content object attribute data to proper value
  *
  * @param eZContentObjectAttribute $objectAttribute
  * @param $string
  */
 public function fromString($objectAttribute, $string)
 {
     $content = unserialize($string);
     if ($content === false) {
         if (!empty($string) && is_string($string)) {
             $content = array($string);
         }
     }
     $objectAttribute->setContent($content);
 }
开发者ID:netgen,项目名称:enhancedselection2,代码行数:16,代码来源:sckenhancedselectiontype.php

示例5: unserializeContentObjectAttribute

 /**
  * Deserializes the content object attribute from provided DOM node
  *
  * @param eZPackage $package
  * @param eZContentObjectAttribute $objectAttribute
  * @param DOMNode $attributeNode
  */
 function unserializeContentObjectAttribute($package, $objectAttribute, $attributeNode)
 {
     $idString = $attributeNode->getElementsByTagName('id-string')->item(0)->textContent;
     $keywordString = $attributeNode->getElementsByTagName('keyword-string')->item(0)->textContent;
     $parentString = $attributeNode->getElementsByTagName('parent-string')->item(0)->textContent;
     $eztags = new eZTags();
     $eztags->createFromStrings($idString, $keywordString, $parentString);
     $objectAttribute->setContent($eztags);
 }
开发者ID:netbliss,项目名称:eztags,代码行数:16,代码来源:eztagstype.php

示例6: initializeObjectAttribute

 /**
  * Init attribute ( also handles version to version copy, and attribute to attribute copy )
  *
  * @param eZContentObjectAttribute $contentObjectAttribute
  * @param int|null                 $currentVersion
  * @param eZContentObjectAttribute $originalContentObjectAttribute
  */
 function initializeObjectAttribute($contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
 {
     if ($currentVersion !== false) {
         $metas = $originalContentObjectAttribute->content();
         /** @var FieldValue $metas */
         if ($metas instanceof FieldValue) {
             $contentObjectAttribute->setContent($metas);
             $this->storeObjectAttribute($contentObjectAttribute);
             return;
         }
     }
 }
开发者ID:rihards,项目名称:NovaeZSEOBundle,代码行数:19,代码来源:novaseometastype.php


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