PHP Class Mongolid\Serializer\Type\Converter

Datei anzeigen Open project: leroy-merlin-br/mongolid Class Usage Examples

Protected Properties

Property Type Description
$mappedTypes string[]

Public Methods

Method Description
__construct ( ) Constructor.
toDomainTypes ( array $data ) : mixed Unconverts recursively the given objects (probably retrieved from MongoDB) to our specific types.
toMongoTypes ( array $data ) : mixed Converts recursively the given data to persistable objects into database.

Protected Methods

Method Description
getReflectionClass ( mixed $className ) : mixed Returns the mapped type of the given className.

Method Details

__construct() public method

Constructor.
public __construct ( )

getReflectionClass() protected method

Returns the mapped type of the given className.
protected getReflectionClass ( mixed $className ) : mixed
$className mixed Name of the class to return.
return mixed

toDomainTypes() public method

Example: converts MongoDB\BSON\ObjectID to Type\ObjectID
public toDomainTypes ( array $data ) : mixed
$data array Array to convert.
return mixed

toMongoTypes() public method

Example: converts Type\ObjectID to MongoDB\BSON\ObjectID.
public toMongoTypes ( array $data ) : mixed
$data array Array to convert.
return mixed

Property Details

$mappedTypes protected_oe property

protected string[] $mappedTypes
return string[]