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


PHP eZContentObjectAttribute类代码示例

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


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

示例1: getAttributeData

    /**
     * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize
     * @return array for further processing
     */

    public static function getAttributeData ( eZContentObjectAttribute $contentObjectAttribute )
    {
        $dataTypeIdentifier = $contentObjectAttribute->attribute( 'data_type_string' );
        $contentClassAttribute = eZContentClassAttribute::fetch( $contentObjectAttribute->attribute( 'contentclassattribute_id' ) );
        $attributeHandler =  $dataTypeIdentifier . 'SolrStorage';
        // prefill the array with generic metadata first
        $target = array (
            'data_type_identifier' => $dataTypeIdentifier,
            'version_format' => self::STORAGE_VERSION_FORMAT,
            'attribute_identifier' => $contentClassAttribute->attribute( 'identifier' ),
            'has_content' => $contentObjectAttribute->hasContent(),

            );
        if ( class_exists( $attributeHandler ) )
        {
            $attributeContent = call_user_func( array( $attributeHandler, 'getAttributeContent' ),
                     $contentObjectAttribute, $contentClassAttribute );
            return array_merge( $target, $attributeContent, array( 'content_method' => self::CONTENT_METHOD_CUSTOM_HANDLER ) );

        }
        else
        {
            $target = array_merge( $target, array(
                'content_method' => self::CONTENT_METHOD_TOSTRING,
                'content' => $contentObjectAttribute->toString(),
                'has_rendered_content' => false,
                'rendered' => null
                ));
            return $target;
        }
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:36,代码来源:ezfsolrstorage.php

示例2: checkObjectAttribute

 /**
  * (called for each obj attribute)
  */
 public function checkObjectAttribute(array $contentObjectAttribute)
 {
     // we adopt the ez api instead of acting on raw data
     $contentObjectAttribute = new eZContentObjectAttribute($contentObjectAttribute);
     $binaryFile = $contentObjectAttribute->attribute('content');
     $warnings = array();
     // do not check attributes which do not even contain images
     if ($binaryFile) {
         // get path to original file
         $filePath = $binaryFile->attribute('filepath');
         // check if it is on fs (remember, images are clusterized)
         $file = eZClusterFileHandler::instance($filePath);
         if (!$file->exists()) {
             $warnings[] = "Binary file not found: {$filePath}" . $this->postfixErrorMsg($contentObjectAttribute);
         } else {
             // if it is, check its size as well
             if ($this->maxSize > 0) {
                 $maxSize = $this->maxSize * 1024 * 1024;
                 if ($file->size() > $maxSize) {
                     $warnings[] = "Binary file larger than {$maxSize} bytes : " . $file->size() . $this->postfixErrorMsg($contentObjectAttribute);
                 }
             }
         }
     } else {
         if (!$this->nullable) {
             $warnings[] = "Attribute is null and it should not be" . $this->postfixErrorMsg($contentObjectAttribute);
         }
     }
     return $warnings;
 }
开发者ID:gggeek,项目名称:ezdbintegrity,代码行数:33,代码来源:ezdbiezbinaryfilechecker.php

示例3: getAttributeContent

    /**
     * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize
     * @param eZContentClassAttribute $contentClassAttribute the content class of the attribute to serialize
     * @return array
     */
    public static function getAttributeContent( eZContentObjectAttribute $contentObjectAttribute, eZContentClassAttribute $contentClassAttribute )
    {
        $content = $contentObjectAttribute->attribute( 'content' );
        $multioptionArray = array(
            'name' => $content->attribute( 'name' ),
        );

        foreach ( $content->attribute( 'multioption_list' ) as $option )
        {
            $optionArray = array(
                'name' => $option['name'],
                'default_option_id' => $option['default_option_id']
            );
            foreach ( $option['optionlist'] as $value )
            {
                $optionArray['optionlist'][] = array(
                    'value' => $value['value'],
                    'additional_price' => $value['additional_price']
                );
            }
            $multioptionArray['multioption_list'][] = $optionArray;
        }

        return array(
            'content' => $multioptionArray,
            'has_rendered_content' => false,
            'rendered' => null,
        );
    }
开发者ID:ataxel,项目名称:tp,代码行数:34,代码来源:ezmultioptionsolrstorage.php

示例4: getAttributeContent

 /**
  * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize
  * @param eZContentClassAttribute $contentClassAttribute the content class of the attribute to serialize
  * @return array
  */
 public static function getAttributeContent(eZContentObjectAttribute $contentObjectAttribute, eZContentClassAttribute $contentClassAttribute)
 {
     $authorList = array();
     foreach ($contentObjectAttribute->attribute('content')->attribute('author_list') as $author) {
         $authorList[] = array('id' => $author['id'], 'name' => $author['name'], 'email' => $author['email']);
     }
     return array('content' => $authorList, 'has_rendered_content' => false, 'rendered' => null);
 }
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:13,代码来源:ezauthorsolrstorage.php

示例5: getAttributeContent

 /**
  * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize
  * @param eZContentClassAttribute $contentClassAttribute the content class of the attribute to serialize
  * @return array
  */
 public static function getAttributeContent(eZContentObjectAttribute $contentObjectAttribute, eZContentClassAttribute $contentClassAttribute)
 {
     $availableEnumerations = array();
     foreach ($contentObjectAttribute->content()->ObjectEnumerations as $enumeration) {
         $availableEnumerations[] = array('id' => $enumeration->EnumID, 'element' => $enumeration->EnumElement, 'value' => $enumeration->EnumValue);
     }
     return array('content' => $availableEnumerations, 'has_rendered_content' => false, 'rendered' => null);
 }
开发者ID:netbliss,项目名称:ezfind,代码行数:13,代码来源:ezenumsolrstorage.php

示例6: getAttributeContent

 /**
  * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize
  * @param eZContentClassAttribute $contentClassAttribute the content class of the attribute to serialize
  * @return array
  */
 public static function getAttributeContent( eZContentObjectAttribute $contentObjectAttribute, eZContentClassAttribute $contentClassAttribute )
 {
     return array(
         'content' => $contentObjectAttribute->content()->KeywordArray,
         'has_rendered_content' => false,
         'rendered' => null,
     );
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:13,代码来源:ezkeywordsolrstorage.php

示例7: getAttributeContent

 /**
  * Returns the content of the matrix to be stored in Solr
  *
  * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize
  * @param eZContentClassAttribute $contentClassAttribute the content class of the attribute to serialize
  * @return array
  */
 public static function getAttributeContent(eZContentObjectAttribute $contentObjectAttribute, eZContentClassAttribute $contentClassAttribute)
 {
     $rows = $contentObjectAttribute->content()->attribute('rows');
     $target = array('has_rendered_content' => false, 'rendered' => null, 'content' => array());
     foreach ($rows['sequential'] as $elt) {
         $target['content'][] = $elt['columns'];
     }
     return $target;
 }
开发者ID:legende91,项目名称:ez,代码行数:16,代码来源:ezmatrixsolrstorage.php

示例8: getAttributeContent

 /**
  * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize
  * @param eZContentClassAttribute $contentClassAttribute the content class of the attribute to serialize
  * @return array
  */
 public static function getAttributeContent(eZContentObjectAttribute $contentObjectAttribute, eZContentClassAttribute $contentClassAttribute)
 {
     $content = $contentObjectAttribute->attribute('content');
     $optionArray = array('name' => $content->attribute('name'));
     foreach ($content->attribute('option_list') as $value) {
         $optionArray['option_list'][] = array('id' => $value['id'], 'value' => $value['value'], 'additional_price' => $value['additional_price'], 'is_default' => $value['is_default']);
     }
     return array('content' => $optionArray, 'has_rendered_content' => false, 'rendered' => null);
 }
开发者ID:netbliss,项目名称:ezfind,代码行数:14,代码来源:ezoptionsolrstorage.php

示例9: getAttributeContent

 /**
  * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize
  * @param eZContentClassAttribute $contentClassAttribute the content class of the attribute to serialize
  * @return array
  */
 public static function getAttributeContent(eZContentObjectAttribute $contentObjectAttribute, eZContentClassAttribute $contentClassAttribute)
 {
     $objectAttributeContent = $contentObjectAttribute->attribute('content');
     $objectIDList = array();
     foreach ($objectAttributeContent['relation_list'] as $objectInfo) {
         $objectIDList[] = $objectInfo['contentobject_id'];
     }
     return array('content' => $objectIDList, 'has_rendered_content' => false, 'rendered' => null);
 }
开发者ID:heliopsis,项目名称:ezfind,代码行数:14,代码来源:ezobjectrelationlistsolrstorage.php

示例10: getAttributeContent

 /**
  * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize
  * @param eZContentClassAttribute $contentClassAttribute the content class of the attribute to serialize
  * @return array
  */
 public static function getAttributeContent( eZContentObjectAttribute $contentObjectAttribute, eZContentClassAttribute $contentClassAttribute )
 {
     $dateTime = new DateTime( '@' . $contentObjectAttribute->attribute( 'data_int' ) );
     return array(
         'content' => $dateTime->format( 'c' ),
         'has_rendered_content' => false,
         'rendered' => null,
     );
 }
开发者ID:ataxel,项目名称:tp,代码行数:14,代码来源:ezdatetimesolrstorage.php

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

示例12: contentIsModified

 /**
  * (non-PHPdoc)
  * @see extension/sqliimport/classes/content/diffhandlers/ISQLIDiffHandler::contentIsModified()
  */
 public static function contentIsModified($data, eZContentObjectAttribute $attribute)
 {
     $isModified = false;
     $originalFilename = $attribute->attribute('content')->attribute('original_filename');
     $newFilename = basename((string) $data);
     if ($newFilename != $originalFilename) {
         $isModified = true;
     }
     return $isModified;
 }
开发者ID:nicolasaguenot,项目名称:sqliimport,代码行数:14,代码来源:sqlibinaryfilediffhandler.php

示例13: validateStringHTTPInput

 /**
  * Validates $data with the constraints defined on the class attribute
  *
  * @param $data
  * @param eZContentObjectAttribute $contentObjectAttribute
  * @param eZContentClassAttribute $classAttribute
  *
  * @return int
  */
 function validateStringHTTPInput($data, $contentObjectAttribute, $classAttribute)
 {
     $maxLen = $classAttribute->attribute(self::MAX_LEN_FIELD);
     $textCodec = eZTextCodec::instance(false);
     if ($textCodec->strlen($data) > $maxLen and $maxLen > 0) {
         $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The input text is too long. The maximum number of characters allowed is %1.'), $maxLen);
         return eZInputValidator::STATE_INVALID;
     }
     return eZInputValidator::STATE_ACCEPTED;
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:19,代码来源:ezstringtype.php

示例14: getAttributeContent

    /**
     * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize
     * @param eZContentClassAttribute $contentClassAttribute the content class of the attribute to serialize
     * @return array with keys 'content', 'has_rendered_content', 'rendered'
     * required first level elements 'method', 'version_format', 'data_type_identifier', 'content'
     * optional first level element is 'rendered' which should store (template) rendered xhtml snippets
     */
    public static function getAttributeContent( eZContentObjectAttribute $contentObjectAttribute, eZContentClassAttribute $contentClassAttribute )
    {

        $target = array(
                'content' => $contentObjectAttribute->content(),
                'has_rendered_content' =>false,
                'rendered' => null
                );

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

示例15: getInstance

 /**
  * Gets the instance of Open Graph attribute handler for the attribute
  *
  * @param eZContentObjectAttribute $objectAttribute
  *
  * @return ngOpenGraphBase
  */
 static function getInstance(eZContentObjectAttribute $objectAttribute)
 {
     $datatypeString = $objectAttribute->attribute('data_type_string');
     $dataTypeHandlers = self::$ogIni->variable('OpenGraph', 'DataTypeHandlers');
     if (array_key_exists($datatypeString, $dataTypeHandlers)) {
         if (class_exists($dataTypeHandlers[$datatypeString])) {
             return new $dataTypeHandlers[$datatypeString]($objectAttribute);
         }
     }
     return new ngOpenGraphBase($objectAttribute);
 }
开发者ID:netgen,项目名称:ngopengraph,代码行数:18,代码来源:ngopengraphbase.php


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