ObjectManagerDecorator
in package
implements
ObjectManager
Base class to simplify ObjectManager decorators
Interfaces, Classes, Traits and Enums
- ObjectManager
- Contract for a Doctrine persistence layer ObjectManager class to implement.
Table of Contents
- $wrapped : ObjectManager
- clear() : void
- Clears the ObjectManager. All objects that are currently managed by this ObjectManager become detached.
- contains() : bool
- Checks if the object is part of the current UnitOfWork and therefore managed.
- detach() : void
- Detaches an object from the ObjectManager, causing a managed object to become detached. Unflushed changes made to the object if any (including removal of the object), will not be synchronized to the database.
- find() : object|null
- Finds an object by its identifier.
- flush() : void
- Flushes all changes to objects that have been queued up to now to the database.
- getClassMetadata() : ClassMetadata
- Returns the ClassMetadata descriptor for a class.
- getMetadataFactory() : ClassMetadataFactory
- Gets the metadata factory used to gather the metadata of classes.
- getRepository() : ObjectRepository
- Gets the repository for a class.
- initializeObject() : void
- Helper method to initialize a lazy loading proxy or persistent collection.
- merge() : object
- Merges the state of a detached object into the persistence context of this ObjectManager and returns the managed copy of the object.
- persist() : void
- Tells the ObjectManager to make an instance managed and persistent.
- refresh() : void
- Refreshes the persistent state of an object from the database, overriding any local changes that have not yet been persisted.
- remove() : void
- Removes an object instance.
Properties
$wrapped
protected
ObjectManager
$wrapped
Methods
clear()
Clears the ObjectManager. All objects that are currently managed by this ObjectManager become detached.
public
clear([mixed $objectName = null ]) : void
Parameters
- $objectName : mixed = null
-
if given, only objects of this type will get detached.
Return values
void —contains()
Checks if the object is part of the current UnitOfWork and therefore managed.
public
contains(mixed $object) : bool
Parameters
- $object : mixed
Return values
bool —detach()
Detaches an object from the ObjectManager, causing a managed object to become detached. Unflushed changes made to the object if any (including removal of the object), will not be synchronized to the database.
public
detach(mixed $object) : void
Parameters
- $object : mixed
-
The object to detach.
Return values
void —find()
Finds an object by its identifier.
public
find(mixed $className, mixed $id) : object|null
Parameters
- $className : mixed
-
The class name of the object to find.
- $id : mixed
-
The identity of the object to find.
Return values
object|null —The found object.
flush()
Flushes all changes to objects that have been queued up to now to the database.
public
flush() : void
Return values
void —getClassMetadata()
Returns the ClassMetadata descriptor for a class.
public
getClassMetadata(mixed $className) : ClassMetadata
Parameters
- $className : mixed
Return values
ClassMetadata —getMetadataFactory()
Gets the metadata factory used to gather the metadata of classes.
public
getMetadataFactory() : ClassMetadataFactory
Return values
ClassMetadataFactory —getRepository()
Gets the repository for a class.
public
getRepository(mixed $className) : ObjectRepository
Parameters
- $className : mixed
Return values
ObjectRepository —initializeObject()
Helper method to initialize a lazy loading proxy or persistent collection.
public
initializeObject(mixed $obj) : void
Parameters
- $obj : mixed
Return values
void —merge()
Merges the state of a detached object into the persistence context of this ObjectManager and returns the managed copy of the object.
public
merge(mixed $object) : object
Parameters
- $object : mixed
Return values
object —persist()
Tells the ObjectManager to make an instance managed and persistent.
public
persist(mixed $object) : void
Parameters
- $object : mixed
-
The instance to make managed and persistent.
Return values
void —refresh()
Refreshes the persistent state of an object from the database, overriding any local changes that have not yet been persisted.
public
refresh(mixed $object) : void
Parameters
- $object : mixed
-
The object to refresh.
Return values
void —remove()
Removes an object instance.
public
remove(mixed $object) : void
Parameters
- $object : mixed
-
The object instance to remove.