class Manager implements ObjectManager (View source)

Properties

protected $configuration
protected $binding
protected $metadataFactory
protected $cache
protected $proxyFactory
protected $uow

Methods

__construct(BindingInterface $binding, Configuration $configuration)

Instatiates a new Mapper, injecting the $mapper that will be used to hydrate record retrieved through the $binding.

detach(stdClass $object)

No description

array|Mixed
execute(Query $query, $fetchPlan = null)

Executes a $query against OrientDB.

getReference($rid)

Returns a reference to an entity. It will be lazily and transparently loaded if anything other than the identifier is touched.

Proxy|object
find(string $rid, string $fetchPlan = '*:0')

Queries for an object with the given $rid.

findRecords(array $rids, boolean $lazy = false, mixed $fetchPlan = '*:0')

Queries for an array of objects with the given $rids.

flush()

No description

ClassMetadata
getClassMetadata(string $class)

Gets the $class Metadata.

ClassMetadataFactory
getMetadataFactory()

Returns the Metadata factory associated with this manager.

getProxyFactory()

Returns the ProxyFactory associated with this manager.

Cache
getCache()

Returns the Cache.

Inflector
getInflector()

Returns the Inflector associated with this manager.

getUnitOfWork()

No description

getRepository(string $className)

Returns the Repository class associated with the $class.

initializeObject(object $obj)

Helper method to initialize a lazy loading proxy or persistent collection.

merge(stdClass $object)

No description

persist(stdClass $object)

No description

remove(stdClass $object)

No description

refresh(stdClass $object)

No description

clear(stdClass $object = null)

No description

contains(stdClass $object)

No description

getBinding()

Returns the binding instance used to communicate OrientDB.

getConfiguration()

Returns the Configuration of the Manager

Details

__construct(BindingInterface $binding, Configuration $configuration)

Instatiates a new Mapper, injecting the $mapper that will be used to hydrate record retrieved through the $binding.

Parameters

BindingInterface $binding
Configuration $configuration

detach(stdClass $object)

Parameters

stdClass $object

array|Mixed execute(Query $query, $fetchPlan = null)

Executes a $query against OrientDB.

This method should be used to execute queries which should not return a result (UPDATE, INSERT) or to retrieve multiple objects: to retrieve a single record look at ->find*() methods.

Parameters

Query $query
$fetchPlan

Return Value

array|Mixed

Proxy getReference($rid)

Returns a reference to an entity. It will be lazily and transparently loaded if anything other than the identifier is touched.

Parameters

$rid

Return Value

Proxy

Proxy|object find(string $rid, string $fetchPlan = '*:0')

Queries for an object with the given $rid.

If $lazy loading is used, all of this won't be executed unless the returned Proxy object is called via __invoke, e.g.:

$lazyLoadedRecord = $manager->find('1:1', true);

$record = $lazyLoadedRecord();

Parameters

string $rid
string $fetchPlan

Return Value

Proxy|object

Exceptions

Exception

ArrayCollection findRecords(array $rids, boolean $lazy = false, mixed $fetchPlan = '*:0')

Queries for an array of objects with the given $rids.

In case of laziness a collection of proxies is returned which contain either uninitialized proxies for entities the UnitOfWork didn't know about yet, or already existing ones.

Parameters

array $rids
boolean $lazy
mixed $fetchPlan

Return Value

ArrayCollection

Exceptions

InvalidQueryException

See also

->find()

flush()

ClassMetadata getClassMetadata(string $class)

Gets the $class Metadata.

Parameters

string $class

Return Value

ClassMetadata

ClassMetadataFactory getMetadataFactory()

Returns the Metadata factory associated with this manager.

Return Value

ClassMetadataFactory

ProxyFactory getProxyFactory()

Returns the ProxyFactory associated with this manager.

Return Value

ProxyFactory

Cache getCache()

Returns the Cache.

Return Value

Cache

Inflector getInflector()

Returns the Inflector associated with this manager.

Return Value

Inflector

getUnitOfWork()

Repository getRepository(string $className)

Returns the Repository class associated with the $class.

Parameters

string $className

Return Value

Repository

initializeObject(object $obj)

Helper method to initialize a lazy loading proxy or persistent collection.

This method is a no-op for other objects.

Parameters

object $obj

merge(stdClass $object)

Parameters

stdClass $object

persist(stdClass $object)

Parameters

stdClass $object

remove(stdClass $object)

Parameters

stdClass $object

refresh(stdClass $object)

Parameters

stdClass $object

clear(stdClass $object = null)

Parameters

stdClass $object

contains(stdClass $object)

Parameters

stdClass $object

BindingInterface getBinding()

Returns the binding instance used to communicate OrientDB.

Return Value

BindingInterface

Configuration getConfiguration()

Returns the Configuration of the Manager

Return Value

Configuration