class Hydrator (View source)

Class Hydrator

Constants

ORIENT_PROPERTY_CLASS

Properties

protected $proxyFactory
protected $metadataFactory
protected $enableMismatchesTolerance
protected $inflector
protected $binding
protected $uow
protected $cache
protected $caster
protected $castedProperties
protected $clusterMap

Methods

__construct(UnitOfWork $uow)

No description

mixed
load(array $rids, string $fetchPlan = null)

No description

Result
hydrate(stdClass $orientObject, Proxy $proxy = null)

Takes an Doctrine\OrientDB JSON object and finds the class responsible to map that object.

hydrateCollection(array $collection)

Hydrates an array of documents.

hydrateRid(Rid $rid)

No description

getProxyFactory()

Returns the ProxyFactory to which the hydrator is attached.

getMetadataFactory()

Returns the MetadataFactor.

getUnitOfWork()

No description

object
createDocument(string $class, stdClass $orientObject)

Either tries to get the proxy

mixed
castProperty(Property $annotation, mixed $propertyValue)

Casts a value according to how it was annotated.

getCastedPropertyCacheKey($type, $value)

No description

Cache
getCache()

Returns the caching layer of the mapper.

object
fill(object $document, stdClass $object)

Given an object and an Orient-object, it fills the former with the latter.

getCaster()

Returns the caster instance.

mixed|null
hydrateValue($value, Property $annotation)

Hydrates the value

enableMismatchesTolerance(bool $tolerate)

Sets whether the Hydrator should tolerate mismatches during hydration.

bool
toleratesMismatches()

Checks whether the Hydrator throws exceptions or not when encountering an mismatch error during hydration.

verifyCastingSupport(Caster $caster, string $method, string $annotationType)

Verifies if the given $caster supports casting with $method.

Details

__construct(UnitOfWork $uow)

Parameters

UnitOfWork $uow

mixed load(array $rids, string $fetchPlan = null)

Parameters

array $rids
string $fetchPlan

Return Value

mixed

Result hydrate(stdClass $orientObject, Proxy $proxy = null)

Takes an Doctrine\OrientDB JSON object and finds the class responsible to map that object.

If the class is found, a new POPO is instantiated and the properties inside the JSON object are filled accordingly.

Parameters

stdClass $orientObject
Proxy $proxy

Return Value

Result

Exceptions

DocumentNotFoundException

ArrayCollection hydrateCollection(array $collection)

Hydrates an array of documents.

Parameters

array $collection

Return Value

ArrayCollection

hydrateRid(Rid $rid)

Parameters

Rid $rid

protected ProxyFactory getProxyFactory()

Returns the ProxyFactory to which the hydrator is attached.

Return Value

ProxyFactory

protected ClassMetadataFactory getMetadataFactory()

Returns the MetadataFactor.

Return Value

ClassMetadataFactory

protected getUnitOfWork()

protected object createDocument(string $class, stdClass $orientObject)

Either tries to get the proxy

Parameters

string $class
stdClass $orientObject

Return Value

object of type $class

protected mixed castProperty(Property $annotation, mixed $propertyValue)

Casts a value according to how it was annotated.

Parameters

Property $annotation
mixed $propertyValue

Return Value

mixed

protected getCastedPropertyCacheKey($type, $value)

Parameters

$type
$value

protected Cache getCache()

Returns the caching layer of the mapper.

Return Value

Cache

protected object fill(object $document, stdClass $object)

Given an object and an Orient-object, it fills the former with the latter.

Parameters

object $document
stdClass $object

Return Value

object

protected Caster getCaster()

Returns the caster instance.

Return Value

Caster

protected mixed|null hydrateValue($value, Property $annotation)

Hydrates the value

Parameters

$value
Property $annotation

Return Value

mixed|null

Exceptions

Exception

enableMismatchesTolerance(bool $tolerate)

Sets whether the Hydrator should tolerate mismatches during hydration.

Parameters

bool $tolerate

bool toleratesMismatches()

Checks whether the Hydrator throws exceptions or not when encountering an mismatch error during hydration.

Return Value

bool

protected verifyCastingSupport(Caster $caster, string $method, string $annotationType)

Verifies if the given $caster supports casting with $method.

If not, an exception is raised.

Parameters

Caster $caster
string $method
string $annotationType

Exceptions

Exception