Returns the content data for the given content object attribute.

@param eZContentObjectAttribute $contentObjectAttribute
@return eZPage
552032
function objectAttributeContent( $contentObjectAttribute )
    {
        $source = $contentObjectAttribute->attribute( 'data_text' );
        $page = eZPage::createFromXML( $source );

        return $page;
    }
167286
public function serializeContentObjectAttribute($package, $objectAttribute)
    {
        $node = $this->createContentObjectAttributeDOMNode($objectAttribute);

        $value = $objectAttribute->content();
        $value = $value instanceof Value ? $value : $this->fieldType->getEmptyValue();

        $xml = clone $value->xml;

        $this->transformLinksToRemoteLinks($xml);

        $dom = $node->ownerDocument;

        $valueNode = $dom->createElement('rich-text-xml');
        $valueNode->appendChild($dom->createTextNode($xml->saveXML()));
        $node->appendChild($valueNode);

        return $node;
    }
1057611
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion != false )
        {
//             $contentObjectAttributeID = $contentObjectAttribute->attribute( "id" );
//             $currentObjectAttribute = eZContentObjectAttribute::fetch( $contentObjectAttributeID,
//                                                                         $currentVersion );
            $dataText = $originalContentObjectAttribute->attribute( "data_text" );
            $contentObjectAttribute->setAttribute( "data_text", $dataText );
        }
        else
        {
            $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
            $default = $contentClassAttribute->attribute( 'data_text1' );
            if ( $default !== '' && $default !== NULL )
            {
                $contentObjectAttribute->setAttribute( 'data_text', $default );
            }
        }
    }
1190951
function objectAttributeContent( $contentObjectAttribute )
    {
        $content = $contentObjectAttribute->attribute( "data_text" );
        if ( trim( $content ) == '' )
        {
            $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
            $content = eZIdentifierType::generateIdentifierString( $contentClassAttribute, false );
        }
        return $content;
    }
306787
function storeObjectAttribute( $contentObjectAttribute )
    {
        $contentClassAttributeID = $contentObjectAttribute->ContentClassAttributeID;
        $contentObjectID = $contentObjectAttribute->ContentObjectID;
        $contentObjectVersion = $contentObjectAttribute->Version;
        $languageCode = $contentObjectAttribute->attribute( 'language_code' );

        /** @var eZContentObject */
        $contentObject = $contentObjectAttribute->object();

        if ( $contentObjectAttribute->ID !== null )
        {
            // cleanup previous relations
            $contentObject->removeContentObjectRelation( false, $contentObjectVersion, $contentClassAttributeID, eZContentObject::RELATION_ATTRIBUTE );

            // if translatable, we need to re-add the relations for other languages of (previously) published version.
            $publishedVersionNo = $contentObject->publishedVersion();
            if ( $contentObjectAttribute->contentClassAttributeCanTranslate() && $publishedVersionNo > 0 )
            {
                $existingRelations = array();

                // get published translations of this attribute
                $pubAttribute = eZContentObjectAttribute::fetch($contentObjectAttribute->ID, $publishedVersionNo );
                if ( $pubAttribute )
                {
                    foreach( $pubAttribute->fetchAttributeTranslations() as $attributeTranslation )
                    {
                        // skip if language is the one being saved
                        if ( $attributeTranslation->LanguageCode === $languageCode )
                            continue;

                        if ( $attributeTranslation->attribute( 'data_int' ) )
                            $existingRelations[$attributeTranslation->LanguageCode] = (int)$attributeTranslation->attribute( 'data_int' );
                    }
                }

                // fetch existing attribute translations for current editing version
                foreach( $contentObjectAttribute->fetchAttributeTranslations() as $attributeTranslation )
                {
                    if ( $attributeTranslation->LanguageCode === $languageCode )
                        continue;

                    if ( $attributeTranslation->attribute( 'data_int' ) )
                        $existingRelations[$attributeTranslation->LanguageCode] = (int)$attributeTranslation->attribute( 'data_int' );
                }

                // re-add existing or new relations for other languages
                foreach( array_unique($existingRelations) as $existingObjectId )
                {
                    $contentObject->addContentObjectRelation( $existingObjectId, $contentObjectVersion, $contentClassAttributeID, eZContentObject::RELATION_ATTRIBUTE );
                }
            }
        }

        $objectID = $contentObjectAttribute->attribute( 'data_int' );
        if ( $objectID )
        {
            $contentObject->addContentObjectRelation( $objectID, $contentObjectVersion, $contentClassAttributeID, eZContentObject::RELATION_ATTRIBUTE );
        }
    }
536022
public function getData()
    {
        $return = array();
        $relations = $this->ContentObjectAttribute->attribute( 'content' );
        foreach ( $relations['relation_list'] as $relation )
        {
            $object = eZContentObject::fetch( $relation['contentobject_id'] );
            if ( $object instanceof eZContentObject )
            {
                $return[] = $object->attribute( 'name' );
            }
        }

        return implode( ', ', $return );
    }
382833
static function fetchByObjectId( $contentobjectID, $contentobjectAttributeId = null )
    {
        $cond = array( 'contentobject_id' => $contentobjectID );
        if ( $contentobjectAttributeId !== null )
        {
            $cond['contentobject_attribute_id'] = $contentobjectAttributeId;
        }
        $return = eZPersistentObject::fetchObjectList( self::definition(), null, $cond );
        return $return;
    }
754009
function objectAttributeContent( $contentObjectAttribute )
    {
        $data = $contentObjectAttribute->attribute( self::CONTENT_VALUE );
        $classAttribute = $contentObjectAttribute->contentClassAttribute();
        $classContent = $classAttribute->content();
        if ( isset( $classContent['ISBN13'] ) and $classContent['ISBN13'] )
        {
            list ( $prefix, $field1, $field2, $field3, $field4 ) = array_merge( preg_split( '#-#', $data ),
                                                                       array( 0 => '', 1 => '', 2 => '', 3 => '', 4 => '' ) );
            $dataArray = array(  'prefix' => $prefix,
                                 'field1' => $field1, 'field2' => $field2,
                                 'field3' => $field3, 'field4' => $field4,
                                 'value' => $data,
                                 'value_without_hyphens' => str_replace( "-", "", $data ),
                                 'value_with_spaces' => str_replace( "-", " ", $data ) );
            return $dataArray;
        }

        // The array_merge makes sure missing elements gets an empty string instead of NULL
        list ( $field1, $field2, $field3, $field4 ) = array_merge( preg_split( '#-#', $data ),
                                                                   array( 0 => '', 1 => '', 2 => '', 3 => '' ) );
        $isbn = array( 'field1' => $field1, 'field2' => $field2,
                       'field3' => $field3, 'field4' => $field4,
                       'value' => $data,
                       'value_without_hyphens' => str_replace( "-", "", $data ),
                       'value_with_spaces' => str_replace( "-", " ", $data ) );
        return $isbn;
    }
761422
function storeObjectAttribute( $contentObjectAttribute )
    {
        $paex = $contentObjectAttribute->content();
        if ( !$paex instanceof eZPaEx )
        {
			// create a default paex object
            $paex = eZPaEx::create( $contentObjectAttribute->attribute( "contentobject_id" ) );
        }
        $paex->store();
        $contentObjectAttribute->setContent( $paex );
    }
1090858
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion != false )
        {
            $contentObjectAttributeID = $originalContentObjectAttribute->attribute( "id" );
            $version = $contentObjectAttribute->attribute( "version" );
            $oldfile = eZBinaryFile::fetch( $contentObjectAttributeID, $currentVersion );
            if ( $oldfile != null )
            {
                $oldfile->setAttribute( 'contentobject_attribute_id', $contentObjectAttribute->attribute( 'id' ) );
                $oldfile->setAttribute( "version",  $version );
                $oldfile->store();
            }
        }
    }
620699
public static function getMetadataByContent( ezpContent $content )
    {
        $aMetadata = array(
            'objectName'            => $content->name,
            'classIdentifier'       => $content->classIdentifier,
            'datePublished'         => (int)$content->datePublished,
            'dateModified'          => (int)$content->dateModified,
            'objectRemoteId'        => $content->remote_id,
            'objectId'              => (int)$content->id
        );

        return $aMetadata;
    }
738513
static function fetchContentList()
    {
        $contentObjectStatus = eZContentObject::STATUS_PUBLISHED;
        $query = "SELECT ezcontentobject.*
                  FROM ezuser, ezcontentobject, ezuser_setting
                  WHERE ezcontentobject.status = '$contentObjectStatus' AND
                        ezuser_setting.is_enabled = 1 AND
                        ezcontentobject.id = ezuser.contentobject_id AND
                        ezuser_setting.user_id = ezuser.contentobject_id";
        $db = eZDB::instance();
        $rows = $db->arrayQuery( $query );
        return $rows;
    }
1168072
function classAttributeContent( $contentClassAttribute )
    {
        $id = $contentClassAttribute->attribute( 'id' );
        $version = $contentClassAttribute->attribute( 'version' );
        $enum = new eZEnum( $id, $version );
        return $enum;
    }
321690
function contentObject()
    {
        if ( $this->ContentObject === null )
        {
            if ( $this->ContentObjectID == 0 )
            {
                return null;
            }
            $this->ContentObject = eZContentObject::fetch( $this->ContentObjectID );
        }
        return $this->ContentObject;
    }
608613
function title( $contentObjectAttribute, $name = null )
    {
        $object = $this->objectAttributeContent( $contentObjectAttribute );
        if ( $object )
        {
            return $object->attribute( 'name' );
        }
        return false;
    }
1287014
static function rawXMLText( $contentObjectAttribute )
    {
        $text = $contentObjectAttribute->attribute( 'data_text' );
        $timestamp = $contentObjectAttribute->attribute( 'data_int' );
        if ( $timestamp < self::VERSION_30_TIMESTAMP )
        {
            $charset = 'UTF-8';
            $codec = eZTextCodec::instance( false, $charset );
            $text = $codec->convertString( $text );
            $timestamp = self::VERSION_30_TIMESTAMP;
        }
        return $text;
    }
611
function metaData( $contentObjectAttribute )
    {
        $matrix = $contentObjectAttribute->content();
        $columnsArray = $matrix->attribute( 'columns' );
        $columns = $columnsArray['sequential'];
        $metaDataArray = array();
        foreach ( $columns as $column )
        {
            $rows = $column['rows'];
            foreach ( $rows as $row )
            {
                $metaDataArray[] = array( 'id' => $column['identifier'],
                                          'text' => $row );
            }
        }
        return $metaDataArray;
    }