/*!
Sets the information on which attribute the data was fetched from.
See eZImageAliasHandler::originalAttributeData() for more information.
489492
function setOriginalAttributeData( $originalData )
    {
        $this->ContentObjectAttributeData['DataTypeCustom']['original_data'] = $originalData;

        $domTree = $this->domTree();
        $imageOriginalArray = $domTree->getElementsByTagName( "original" );
        if ( $imageOriginalArray->length > 0 )
        {
            $imageOriginalNode = $imageOriginalArray->item( 0 );
            $this->createOriginalAttributeXMLData( $imageOriginalNode, $originalData );
        }
    }
77817
public function setData($data)
    {
        $this->originalData = $data;

        if ($data instanceof \Iterator) {
            $this->iterator = $data;
        }
        elseif (is_array($data)) {
            $this->iterator = new \ArrayIterator($data);
        }
        else {
            $this->iterator = new \ArrayIterator(array($data));
        }
    }
636526
public function setExtraData($extra_data){
        if(!$this->setModified('extra_data', $extra_data)->isModified()){
            return $this;
        }
        $this->extra_data = $extra_data;

        return $this;
    }
1257289
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion == false )
        {
            $option = $contentObjectAttribute->content();
            $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
            if ( !$option )
            {
                $option = new eZRangeOption( $contentClassAttribute->attribute( 'data_text1' ) );
            }
            else
            {
                $option->setName( $contentClassAttribute->attribute( 'data_text1' ) );
            }
            $contentObjectAttribute->setAttribute( "data_text", $option->xmlString() );
            $contentObjectAttribute->setContent( $option );
        }
    }
582102
public function setDataFromPost() {
    // Recorremos el arreglo $data
    foreach ($this->data as $key => $value) {
      // Si existe la llave en $_POST entonces asignamos su valor
      // a $data
      if (isset($_POST[$key])) {
        $this->data[$key] = $_POST[$key];
      }
    }
  }
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 );
            }
        }
    }
295613
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion != false )
        {
            $data = trim( $originalContentObjectAttribute->attribute( self::CLASS_LIST_FIELD ) );
            $contentObjectAttribute->setAttribute( self::CLASS_LIST_FIELD, $data );
        }
    }
609848
public function setData($data)
    {
        if (!is_string($data)) {
            $data = json_encode($data);
        }

        $this->data = $data;
    }
1201494
protected function initializeAttributeOnData( $attribute )
	{
		$explicitPath = $this->getLeadingExplicitAttributePath( $attribute );

		$data = $this->extractDataFromPath( $explicitPath );

		if ( !Str::contains( $attribute, '*' ) || Str::endsWith( $attribute, '*' ) )
		{
			return $data;
		}

		return data_set( $data, $attribute, null, true );
	}
647029
public function setData($data)
    {
        $resultData = $this->hydrateIfJsonToArray($data);
        if (!empty($resultData)) {
            $this->data = $resultData;
        }
        else {
            $this->data = [];
        }
    }
231255
public function setData($data, $allowEmpty = true, $allowUnset = false)
    {
        if ($data != null) {
            if (is_array($data)) {
                $fileds = $this->getFields();
                foreach ($fileds as $field) {
                    if (isset($data[$field]) && ($allowEmpty || $data[$field] !== '')) {
                        if (strpos($this->getFieldType($field), 'varchar') !== false || $this->getFieldType($field) === 'text') {
                            $encoding = mb_detect_encoding($data[$field]);
                            if ($encoding !== 'utf8') {
                                $this->{$field} = mb_convert_encoding($data[$field], 'utf8', $encoding);
                            } else {
                                $this->{$field} = $data[$field];
                            }
                        } else {
                            $this->{$field} = $data[$field];
                        }
                    } elseif ($allowUnset) {
                        $this->{$field} = false;
                    }
                }
            } else {
                $result = $this->get($data);
                $this->setData($result->model);
                if (empty($result->model)) {
                    $this->asDefault();
                }
            }
        }
        if (empty($data)) {
            $this->asDefault();
        }
        return $this;
    }
276357
public void assignData(XEvent event, String data) {
                if (data != null && data.trim().length() > 0) {
                        XAttributeLiteral attr = (XAttributeLiteral) ATTR_DATA.clone();
                        attr.setValue(data.trim());
                        event.getAttributes().put(KEY_DATA, attr);
                }
        }
87927
function storeObjectAttribute( $contentObjectAttribute )
    {
        if ( $contentObjectAttribute->attribute( 'data_int' ) != 0 )
        {
    	   $gp = $contentObjectAttribute->attribute( 'content' );
	        if ( $gp instanceof eZGmapLocation )
	        {
	            $gp->store();
	            return true;
	        }
        }
        return false;
    }
407043
private function setPostData($data = null)
    {
        if (null === $data) {
            curl_setopt($this->curl, CURLOPT_POST, false);

            return;
        }
        $postData = '';
        foreach ($data as $key => $value) {
            $postData .= urlencode($key) . '=' . urlencode($value) . '&';
        }
        if ($postData != '') {
            curl_setopt($this->curl, CURLOPT_POST, true);
            curl_setopt($this->curl, CURLOPT_POSTFIELDS, substr($postData, 0, -1));
        }
    }
701206
public function setOldAttribute($data = null) {
        if (is_null($data)) {
            $data = $this->getAttribute();
        }
        $this->isNewRecord = false;
        $this->__oldAttributes = array_merge($this->__oldAttributes, $data);
        return $this;
    }
885967
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {
        if ( $currentVersion != false )
        {
            $originalContentObjectAttributeID = $originalContentObjectAttribute->attribute( 'id' );
            $contentObjectAttributeID = $contentObjectAttribute->attribute( 'id' );
            $contentObjectAttributeVersion = $contentObjectAttribute->attribute( 'version' );

            $db = eZDB::instance();
            $db->begin();

            // Delete stored object attributes when initialize translated attribute.
            if ( $originalContentObjectAttributeID != $contentObjectAttributeID )
                $this->deleteStoredObjectAttribute( $contentObjectAttribute, $currentVersion );

            $newVersionEnumObject = eZEnumObjectValue::fetchAllElements( $originalContentObjectAttributeID, $currentVersion );

            for ( $i = 0; $i < count( $newVersionEnumObject ); ++$i )
            {
                $enumobjectvalue =  $newVersionEnumObject[$i];
                $enumobjectvalue->setAttribute( 'contentobject_attribute_id', $contentObjectAttribute->attribute( 'id' ) );
                $enumobjectvalue->setAttribute( 'contentobject_attribute_version',  $contentObjectAttributeVersion );
                $enumobjectvalue->store();
            }

            $db->commit();
        }
    }
1195018
function setData(el, attr, val, prefix) {
    if (prefix === undefined) {
      prefix = 'wookmark-';
    }
    el.setAttribute('data-' + prefix + attr, val);
  }