Doctrine\Common\Persistence\ObjectManager
Contract for a Doctrine persistence layer ObjectManager class to implement.
- Author: Benjamin Eberlei <kontakt@beberlei.de>
- License: http://www.opensource.org/licenses/lgpl-license.php LGPL
Synopsis
interface ObjectManager
{
- // methods
- public find()
- public void persist()
- public void remove()
- public merge()
- public void clear()
- public void detach()
- public void refresh()
- public void flush()
- public ObjectRepository getRepository()
- public ClassMetadata getClassMetadata()
- public ClassMetadataFactory getMetadataFactory()
- public void initializeObject()
- public bool contains()
Methods
public
- clear() — Clears the ObjectManager. All objects that are currently managed by this ObjectManager become detached.
- contains() — Check if the object is part of the current UnitOfWork and therefore managed.
- 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.
- find() — Finds a object by its identifier.
- flush() — Flushes all changes to objects that have been queued up to now to the database.
- getClassMetadata() — Returns the ClassMetadata descriptor for a class.
- getMetadataFactory() — Gets the metadata factory used to gather the metadata of classes.
- getRepository() — Gets the repository for a class.
- initializeObject() — Helper method to initialize a lazy loading proxy or persistent collection.
- merge() — Merges the state of a detached object into the persistence context of this ObjectManager and returns the managed copy of the object.
- persist() — Tells the ObjectManager to make an instance managed and persistent.
- refresh() — Refreshes the persistent state of an object from the database, overriding any local changes that have not yet been persisted.
- remove() — Removes an object instance.