PHP Class Doctrine\ODM\CouchDB\Mapping\EmbeddedDocumentSerializer

Since: 1.0
Author: Bartfai Tamas ([email protected])
Exibir arquivo Open project: doctrine/couchdb-odm

Public Methods

Method Description
__construct ( $metadataFactory, $metadataResolver )
createEmbeddedDocument ( array $data, object $embeddedFieldMapping ) : object Create a document for an embedded document field mapping from json data.
doCreateEmbeddedDocument ( $data, $embeddedFieldMapping )
isChanged ( array $value, object $originalData, array $valueFieldMapping ) : boolean Compares the two representation of an embedded document.
serializeEmbeddedDocument ( object $embeddedValue, array $embeddedFieldMapping, $embedMany = false ) : array Serializes an embedded document value into array given the mapping metadata for the class.

Method Details

__construct() public method

public __construct ( $metadataFactory, $metadataResolver )

createEmbeddedDocument() public method

Create a document for an embedded document field mapping from json data.
public createEmbeddedDocument ( array $data, object $embeddedFieldMapping ) : object
$data array
$embeddedFieldMapping object
return object

doCreateEmbeddedDocument() public method

public doCreateEmbeddedDocument ( $data, $embeddedFieldMapping )

isChanged() public method

If the original misses doctrine_metadata, but the values are the same, we assume there is no change If the original has doctrine_metadata, and the new value has different class, that's a change, even if the values are the same.
public isChanged ( array $value, object $originalData, array $valueFieldMapping ) : boolean
$value array
$originalData object
$valueFieldMapping array Mapping of the field that contains the embedded document in the embedder document.
return boolean

serializeEmbeddedDocument() public method

Serializes an embedded document value into array given the mapping metadata for the class.
public serializeEmbeddedDocument ( object $embeddedValue, array $embeddedFieldMapping, $embedMany = false ) : array
$embeddedValue object
$embeddedFieldMapping array
$embedMany
return array