Stores the datatype data to the database which is related to the object attribute.

@param eZContentObjectAttribute $contentObjectAttribute
@return bool
495674
function storeObjectAttribute( $contentObjectAttribute )
    {
        $page = $contentObjectAttribute->content();
        $contentObjectAttribute->setAttribute( 'data_text', $page->toXML() );
        return true;
    }
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 );
    }
915512
public function setContentType($contentType)
    {
        if (is_bool(strpos($contentType, 'charset=')) && $this->charset) {
            $contentType .= '; charset=' . $this->charset;
        }
        
        $this->headers['Content-Type'] = $contentType;
        return $this;
    }
766740
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion != false )
        {
            $dataText = $originalContentObjectAttribute->attribute( "data_text" );
            $contentObjectAttribute->setAttribute( "data_text", $dataText );
        }
    }
25394
function assignValue( $contentClassAttribute, $contentObjectAttribute )
    {

        $retValue = false;
        $ret = array();
        $version = $contentObjectAttribute->attribute( 'version' );
        $contentClassAttributeID = $contentClassAttribute->attribute( 'id' );
        $objectID = (int)$contentObjectAttribute->attribute( 'contentobject_id' );
        $classAttributeID = (int)$contentObjectAttribute->attribute( 'contentclassattribute_id' );

        $db = eZDB::instance();

        $existingIDs = $db->arrayQuery( "SELECT data_int " .
                                        "FROM   ezcontentobject_attribute " .
                                        "WHERE  contentobject_id = $objectID AND" .
                                        "       contentclassattribute_id = $classAttributeID AND" .
                                        "       data_type_string = 'ezidentifier' AND" .
                                        "       data_int != 0" );
        if ( count( $existingIDs ) > 0 )
        {
            $identifierValue = $existingIDs[0]['data_int'];
            $ret[] = eZIdentifierType::storeIdentifierValue( $contentClassAttribute, $contentObjectAttribute, $identifierValue );
        }
        else
        {
            $db->begin();

            // Ensure that we don't get another identifier with the same id, so lock ezcontentclass_attribute
            $db->lock( array( array( 'table' => 'ezcontentclass_attribute' ) ) );

            $selectQuery = "SELECT data_int3 FROM ezcontentclass_attribute WHERE " .
                 "id=$contentClassAttributeID AND version=0";
            $result = $db->arrayQuery( $selectQuery );
            $identifierValue = $result[0]['data_int3'];

            // should only increment when we don't have the first version
            $updateQuery = "UPDATE ezcontentclass_attribute SET data_int3=data_int3 + 1 WHERE " .
                  "id=$contentClassAttributeID AND version=0";

            $ret[] = $db->query( $updateQuery );

            $db->unlock();
            // unlock before we start to update the ezcontentobject_attribute table

            $ret[] = eZIdentifierType::storeIdentifierValue( $contentClassAttribute, $contentObjectAttribute, $identifierValue );

            if ( !in_array( false, $ret ) )
            {
                // Now make sure all existing versions (if any) gets the same identifier
                $dataText = $db->escapeString( $contentObjectAttribute->attribute( 'data_text' ) );
                $dataInt = (int)$contentObjectAttribute->attribute( 'data_int' );

                $trans = eZCharTransform::instance();
                $sortText = $db->escapeString( $trans->transformByGroup( $contentObjectAttribute->attribute( 'data_text' ),
                                                                         'lowercase' ) );

                $db->query( "UPDATE ezcontentobject_attribute " .
                            "SET    data_text = '$dataText', data_int = $dataInt, sort_key_string = '$sortText' " .
                            "WHERE  contentobject_id = $objectID AND" .
                            "       contentclassattribute_id = $classAttributeID AND" .
                            "       data_type_string = 'ezidentifier'" );
            }

            if ( !in_array( false, $ret ) )
                $db->commit();
            else
                $db->rollback();
        }

        if ( !in_array( false, $ret ) )
            $retValue = true;

        return $retValue;
    }
1004557
function hasContent()
    {
        $dataType = $this->dataType();
        if ( is_object( $dataType ) )
        {
            return $dataType->hasObjectAttributeContent( $this );
        }
        return false;
    }
853569
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion != false )
        {
            $dataText = $originalContentObjectAttribute->content();
            $contentObjectAttribute->setContent( $dataText );
        }
        else
        {
            $default = array( 'value' => array() );
            $contentObjectAttribute->setContent( $default );
        }
    }
364706
function serializeContentObjectAttribute( $package, $objectAttribute )
    {
        $node = $this->createContentObjectAttributeDOMNode( $objectAttribute );
        $relatedObjectID = $objectAttribute->attribute( 'data_int' );

        if ( $relatedObjectID !== null )
        {
            $relatedObject = eZContentObject::fetch( $relatedObjectID );
            if ( !$relatedObject )
            {
                eZDebug::writeNotice( 'Related object with ID: ' . $relatedObjectID . ' does not exist.' );
            }
            else
            {
                $relatedObjectRemoteID = $relatedObject->attribute( 'remote_id' );
                $dom = $node->ownerDocument;
                $relatedObjectRemoteIDNode = $dom->createElement( 'related-object-remote-id' );
                $relatedObjectRemoteIDNode->appendChild( $dom->createTextNode( $relatedObjectRemoteID ) );
                $node->appendChild( $relatedObjectRemoteIDNode );
            }
        }

        return $node;
    }
748731
function objectAttributeContent( $contentObjectAttribute )
    {
        $objectID = $contentObjectAttribute->attribute( "data_int" );
        if ( $objectID != 0 )
            $object = eZContentObject::fetch( $objectID );
        else
            $object = null;
        return $object;
    }
955730
function removeContentObjectRelation( $contentObjectAttribute )
    {
        $obj = $contentObjectAttribute->object();
        $atrributeTrans = $contentObjectAttribute->fetchAttributeTranslations( );
        // Check if current relation exists in ezcontentobject_link
        foreach ( $atrributeTrans as $attrTarns )
        {
            if ( $attrTarns->attribute( 'id' ) != $contentObjectAttribute->attribute( 'id' ) )
                if ( $attrTarns->attribute( 'data_int' ) == $contentObjectAttribute->attribute( 'data_int' ) )
                     return;
        }

        //get eZContentObjectVersion
        $currVerobj = $obj->currentVersion();
        // get array of ezcontentobjecttranslations
        $transList = $currVerobj->translations( false );
        // get count of LanguageCode in transList
        $countTsl = count( $transList );
        // Delete the old version from ezcontentobject_link if count of translations > 1
        if ( $countTsl > 1 )
        {
            $objectID = $contentObjectAttribute->attribute( "data_int" );
            $contentClassAttributeID = $contentObjectAttribute->ContentClassAttributeID;
            $contentObjectID = $contentObjectAttribute->ContentObjectID;
            $contentObjectVersion = $contentObjectAttribute->Version;
            eZContentObject::fetch( $contentObjectID )->removeContentObjectRelation( $objectID, $contentObjectVersion, $contentClassAttributeID, eZContentObject::RELATION_ATTRIBUTE );
        }
    }
929948
public function setContentType($contentType)
    {
        $allowedValues = $this->getContentTypeAllowableValues();
        if (!is_null($contentType) && !in_array($contentType, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'contentType', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['contentType'] = $contentType;

        return $this;
    }
1166697
function unserializeContentObjectAttribute( $package, $objectAttribute, $attributeNode )
    {
        $userNode = $attributeNode->getElementsByTagName( 'account' )->item( 0 );
        if ( is_object( $userNode ) )
        {
            $userID = $objectAttribute->attribute( 'contentobject_id' );
            $user = eZUser::fetch( $userID );
            if ( !is_object( $user ) )
            {
                $user = eZUser::create( $userID );
            }
            $user->setAttribute( 'login', $userNode->getAttribute( 'login' ) );
            $user->setAttribute( 'email', $userNode->getAttribute( 'email' ) );
            $user->setAttribute( 'password_hash', $userNode->getAttribute( 'password_hash' ) );
            $user->setAttribute( 'password_hash_type', eZUser::passwordHashTypeID( $userNode->getAttribute( 'password_hash_type' ) ) );
            $user->store();
        }
    }
348765
function objectAttributeContent( $contentObjectAttribute )
    {
        $stamp = $contentObjectAttribute->attribute( 'data_int' );

        if ( $stamp !== null )
        {
            $time = new eZTime( $stamp );

        }
        else
            $time = array( 'timestamp' => '',
                           'time_of_day' => '',
                           'hour' => '',
                           'minute' => '',
                           'second' => '',
                           'is_valid' => false );
        return $time;
    }
505422
public function save(ContentType $contentType)
    {
        $this->em->persist($contentType);
        $this->em->flush();

        return $contentType;
    }
398001
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 );
    }
749488
public function storeObjectAttribute($objectAttribute)
    {
        $value = $this->storage->storeFieldData($objectAttribute, $objectAttribute->content());

        $objectAttribute->setAttribute(self::RICH_TEXT_FIELD, (string)$value);
    }
588400
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;
    }