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


PHP eZContentObjectAttribute::setAttribute方法代码示例

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


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

示例1: fromString

 /**
  * Generic method wrapping datatype's fromString() method if implemented
  * Checks if fromString() is implemented in the field's datatype
  * If not, data_text will be used by default
  * @see http://projects.ez.no/sqliimport/forum/issues/two_little_thing
  * @param string $data String representation of data to inject
  * @return void
  */
 public function fromString($data)
 {
     $datatype = $this->attribute->attribute('data_type_string');
     $fromStringImplemented = null;
     // First check if datatype is already known as implementing fromString() or not
     // (Better performance as the check is made through Reflection API)
     if (in_array($datatype, self::$datatypesFromStringImpl)) {
         $fromStringImplemented = true;
     } else {
         if (in_array($datatype, self::$datatypesFromStringNotImpl)) {
             $fromStringImplemented = false;
         } else {
             $reflector = new ReflectionObject($this->attribute->dataType());
             $callerClass = $reflector->getMethod('fromString')->class;
             if ($callerClass == 'eZDataType') {
                 self::$datatypesFromStringNotImpl[] = $datatype;
                 $fromStringImplemented = false;
             } else {
                 self::$datatypesFromStringImpl[] = $datatype;
                 $fromStringImplemented = true;
             }
         }
     }
     // Now insert data through the appropriate way
     if ($fromStringImplemented) {
         $this->attribute->fromString($data);
     } else {
         $this->attribute->setAttribute('data_text', $data);
     }
 }
开发者ID:lolautruche,项目名称:sqliimport,代码行数:38,代码来源:sqlicontentfield.php

示例2: initializeObjectAttribute

 /**
  * Initializes the object attribute with some data.
  * @param eZContentObjectAttribute $objectAttribute
  * @param int $currentVersion
  * @param eZContentObjectAttribute $originalContentObjectAttribute
  */
 function initializeObjectAttribute($objectAttribute, $currentVersion, $originalContentObjectAttribute)
 {
     if (NULL === $currentVersion) {
         $data = '';
     } else {
         $data = $originalContentObjectAttribute->attribute("data_text");
     }
     $objectAttribute->setAttribute("data_text", $data);
 }
开发者ID:kaliop-uk,项目名称:ez-class-select-bundle,代码行数:15,代码来源:kclassselecttype.php

示例3: 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

示例4: fetchObjectAttributeHTTPInput

 /**
  * Fetches all variables from the object and handles them
  * Data store can be done here
  * @param eZHTTPTool $http
  * @param string $base POST variable name prefix (Always "ContentObjectAttribute")
  * @param eZContentObjectAttribute $contentObjectAttribute
  * @return true if fetching of class attributes are successfull, false if not
  */
 public function fetchObjectAttributeHTTPInput($http, $base, $contentObjectAttribute)
 {
     if ($http->hasPostVariable($base . '_accolorpicker_data_text_' . $contentObjectAttribute->attribute('id'))) {
         $data = $http->postVariable($base . '_accolorpicker_data_text_' . $contentObjectAttribute->attribute('id'));
         $contentObjectAttribute->setAttribute('data_text', $data);
     }
     return true;
 }
开发者ID:informaticatrentina,项目名称:accolorpicker,代码行数:16,代码来源:accolorpickertype.php

示例5: fetchObjectAttributeHTTPInput

 /**
  * Fetches all variables from the object and handles them
  * Data store can be done here
  *
  * @param eZHTTPTool $http
  * @param string $base POST variable name prefix (Always "ContentObjectAttribute")
  * @param eZContentObjectAttribute $contentObjectAttribute
  * @return true if fetching of object attributes is successful, false if not
  */
 public function fetchObjectAttributeHTTPInput($http, $base, $contentObjectAttribute)
 {
     $fieldName = $base . self::COMMENTS_ENABLED_VARIABLE . $contentObjectAttribute->attribute('id');
     $value = $http->hasPostVariable($fieldName) ? 1 : 0;
     $contentObjectAttribute->setAttribute('data_int', $value);
     return true;
 }
开发者ID:tompsonx,项目名称:ezdisqus,代码行数:16,代码来源:disquscommentstype.php

示例6: unserializeContentObjectAttribute

 /**
  * Unserailize contentobject attribute
  *
  * @param eZPackage $package
  * @param eZContentObjectAttribute $objectAttribute
  * @param DOMElement $attributeNode
  */
 function unserializeContentObjectAttribute($package, $objectAttribute, $attributeNode)
 {
     $rootNode = $attributeNode->childNodes->item(0);
     $xmlString = $rootNode ? $rootNode->ownerDocument->saveXML($rootNode) : '';
     $objectAttribute->setAttribute('data_text', $xmlString);
 }
开发者ID:BGCX067,项目名称:ezpublish-thetechtalent-svn-to-git,代码行数:13,代码来源:ezpagetype.php

示例7: fromString

 /**
  * Imports the data to the attribute
  *
  * @param eZContentObjectAttribute $contentObjectAttribute
  * @param string $string
  *
  * @return string
  */
 function fromString($contentObjectAttribute, $string)
 {
     $contentObjectAttribute->setAttribute(self::OIB_FIELD, trim($string));
 }
开发者ID:netgen,项目名称:ngoib,代码行数:12,代码来源:ngoibtype.php

示例8: fromString

 /**
  * @param eZContentObjectAttribute $contentObjectAttribute
  * @param string $string
  */
 function fromString( $contentObjectAttribute, $string )
 {
     $contentObjectAttribute->setAttribute( 'data_text', $string );
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:8,代码来源:kezserializetype.php

示例9: unserializeContentClassAttribute

 /**
  * Extracts values from the attribute parameters and sets it in the class attribute.
  *
  * @param eZContentObjectAttribute $classAttribute
  * @param DOMElement $attributeNode
  * @param DOMElement $attributeParametersNode
  */
 public function unserializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
 {
     $content = array();
     $delimiter = $attributeParametersNode->getElementsByTagName('delimiter')->item(0)->nodeValue;
     $multiselect = $attributeParametersNode->getElementsByTagName('multiselect')->item(0)->textContent;
     $query = $attributeParametersNode->getElementsByTagName('query')->item(0)->nodeValue;
     $content['delimiter'] = $delimiter !== false ? $delimiter : '';
     $content['is_multiselect'] = $multiselect !== false ? intval($multiselect) : 0;
     $content['query'] = $query !== false ? $query : '';
     $content['options'] = array();
     $optionsNode = $attributeParametersNode->getElementsByTagName('options')->item(0);
     if ($optionsNode instanceof DOMElement && $optionsNode->hasChildNodes()) {
         $children = $optionsNode->childNodes;
         foreach ($children as $key => $child) {
             if ($child instanceof DOMElement) {
                 $content['options'][] = array('id' => $child->getAttribute('id'), 'name' => $child->getAttribute('name'), 'identifier' => $child->getAttribute('identifier'), 'priority' => $child->getAttribute('priority'));
             }
         }
     }
     unset($optionsNode);
     $xmlString = $this->classContentToXml($content);
     $classAttribute->setAttribute(self::CLASS_STORAGE_XML, $xmlString);
 }
开发者ID:netgen,项目名称:enhancedselection2,代码行数:30,代码来源:sckenhancedselectiontype.php

示例10: initializeObjectAttribute

 /**
  * This function is called when a new version is created or an object is copied
  * @param eZContentObjectAttribute $objectAttribute
  * @param integer $currentVersion
  * @param eZContentObjectAttribute $originalContentObjectAttribute
  */
 function initializeObjectAttribute($objectAttribute, $currentVersion, $originalContentObjectAttribute)
 {
     if ($objectAttribute->attribute('contentobject_id') != $originalContentObjectAttribute->attribute('contentobject_id')) {
     }
     // this is a copy of an original object
     // we should remove datas from data_text
     $objectAttribute->setAttribute('data_text', '');
 }
开发者ID:kaliop-uk,项目名称:jcremoteid,代码行数:14,代码来源:jcremoteidtype.php

示例11: fetchObjectAttributeHTTPInput

 /**
  * Set parameters from post data
  *
  * @param eZHTTPTool $http
  * @param string $base
  * @param eZContentObjectAttribute $contentObjectAttribute
  */
 function fetchObjectAttributeHTTPInput($http, $base, $contentObjectAttribute)
 {
     $data = $_REQUEST[$base . '_' . $contentObjectAttribute->attribute('id') . '_related_nodes'];
     $contentObjectAttribute->setAttribute('data_text', serialize($data));
     return true;
 }
开发者ID:eab-dev,项目名称:EabRelatedNodesBundle,代码行数:13,代码来源:relatednodestype.php


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