Method | Description | |
---|---|---|
__construct ( |
Initializes a new UnitOfWork instance, bound to the given EntityManager. | |
addToIdentityMap ( object $entity ) : boolean | INTERNAL: Registers an entity in the identity map. | |
clear ( ) | Clears the UnitOfWork. | |
clearEntityChangeSet ( string $oid ) | INTERNAL: Clears the property changeset of the entity with the given OID. | |
commit ( ) | Commits the UnitOfWork, executing all operations that have been postponed up to this point. The state of all managed entities will be synchronized with the database. | |
computeChangeSet ( Doctrine\ORM\Mapping\ClassMetadata $class, object $entity ) | Computes the changes that happened to a single entity. | |
computeChangeSets ( ) | Computes all the changes that have been done to entities and collections since the last commit and stores these changes in the _entityChangeSet map temporarily for access by the persisters, until the UoW commit is finished. | |
containsIdHash ( string $idHash, string $rootClassName ) : boolean | INTERNAL: Checks whether an identifier hash exists in the identity map. | |
createEntity ( string $className, array $data, array &$hints = [] ) : object | INTERNAL: Creates an entity. Used for reconstitution of persistent entities. | |
detach ( object $entity ) | Detaches an entity from the persistence management. It's persistence will no longer be managed by Doctrine. | |
getByIdHash ( string $idHash, string $rootClassName ) : object | INTERNAL: Gets an entity in the identity map by its identifier hash. | |
getCollectionPersister ( array $association ) : AbstractCollectionPersister | Gets a collection persister for a collection-valued association. | |
getCommitOrderCalculator ( ) : Doctrine\ORM\Internal\CommitOrderCalculator | Gets the CommitOrderCalculator used by the UnitOfWork to order commits. | |
getEntityChangeSet ( $entity ) : array | Gets the changeset for an entity. | |
getEntityIdentifier ( object $entity ) : array | Gets the identifier of an entity. | |
getEntityPersister ( string $entityName ) : Doctrine\ORM\Persister\AbstractEntityPersister | Gets the EntityPersister for an Entity. | |
getEntityState ( object $entity, integer $assume = null ) : integer | Gets the state of an entity with regard to the current unit of work. | |
getIdentityMap ( ) : array | Gets the identity map of the UnitOfWork. | |
getOriginalEntityData ( object $entity ) : array | Gets the original data of an entity. The original data is the data that was present at the time the entity was reconstituted from the database. | |
getScheduledCollectionDeletions ( ) : array | Get the currently scheduled complete collection deletions | |
getScheduledCollectionUpdates ( ) : array | Gets the currently scheduled collection inserts, updates and deletes. | |
getScheduledEntityDeletions ( ) : array | Gets the currently scheduled entity deletions in this UnitOfWork. | |
getScheduledEntityInsertions ( ) : array | Gets the currently scheduled entity insertions in this UnitOfWork. | |
getScheduledEntityUpdates ( ) : array | Gets the currently scheduled entity updates in this UnitOfWork. | |
hasPendingInsertions ( ) : boolean | Checks whether the UnitOfWork has any pending insertions. | |
isCollectionScheduledForDeletion ( Doctrine\ORM\PersistentCollection $coll ) | ||
isEntityScheduled ( $entity ) : boolean | Checks whether an entity is scheduled for insertion, update or deletion. | |
isInIdentityMap ( object $entity ) : boolean | Checks whether an entity is registered in the identity map of this UnitOfWork. | |
isScheduledForDelete ( object $entity ) : boolean | Checks whether an entity is registered as removed/deleted with the unit of work. | |
isScheduledForDirtyCheck ( $entity ) | ||
isScheduledForInsert ( object $entity ) : boolean | Checks whether an entity is scheduled for insertion. | |
isScheduledForUpdate ( object $entity ) : boolean | Checks whether an entity is registered as dirty in the unit of work. | |
loadCollection ( Doctrine\ORM\PersistentCollection $collection ) | Initializes (loads) an uninitialized persistent collection of an entity. | |
lock ( object $entity, integer $lockMode, integer $lockVersion = null ) | Acquire a lock on the given entity. | |
merge ( object $entity ) : object | Merges the state of the given detached entity into this UnitOfWork. | |
persist ( object $entity ) | Persists an entity as part of the current unit of work. | |
propertyChanged ( object $entity, string $propertyName, mixed $oldValue, mixed $newValue ) | Notifies this UnitOfWork of a property change in an entity. | |
recomputeSingleEntityChangeSet ( Doctrine\ORM\Mapping\ClassMetadata $class, object $entity ) | INTERNAL: Computes the changeset of an individual entity, independently of the computeChangeSets() routine that is used at the beginning of a UnitOfWork#commit(). | |
refresh ( object $entity ) | Refreshes the state of the given entity from the database, overwriting any local, unpersisted changes. | |
registerManaged ( object $entity, array $id, array $data ) | INTERNAL: Registers an entity as managed. | |
remove ( object $entity ) | Deletes an entity as part of the current unit of work. | |
removeFromIdentityMap ( object $entity ) : boolean | INTERNAL: Removes an entity from the identity map. This effectively detaches the entity from the persistence management of Doctrine. | |
scheduleCollectionDeletion ( Doctrine\ORM\PersistentCollection $coll ) | INTERNAL: Schedules a complete collection for removal when this UnitOfWork commits. | |
scheduleExtraUpdate ( object $entity, array $changeset ) | INTERNAL: Schedules an extra update that will be executed immediately after the regular entity updates within the currently running commit cycle. | |
scheduleForDelete ( object $entity ) | INTERNAL: Schedules an entity for deletion. | |
scheduleForDirtyCheck ( object $entity ) | Schedules an entity for dirty-checking at commit-time. | |
scheduleForInsert ( object $entity ) | Schedules an entity for insertion into the database. | |
scheduleForUpdate ( object $entity ) | Schedules an entity for being updated. | |
scheduleOrphanRemoval ( object $entity ) | INTERNAL: Schedules an orphaned entity for removal. The remove() operation will be invoked on that entity at the beginning of the next commit of this UnitOfWork. | |
setOriginalEntityData ( $entity, array $data ) | ||
setOriginalEntityProperty ( string $oid, string $property, mixed $value ) | INTERNAL: Sets a property value of the original data array of an entity. | |
size ( ) : integer | Calculates the size of the UnitOfWork. The size of the UnitOfWork is the number of entities in the identity map. | |
tryGetById ( mixed $id, string $rootClassName ) : mixed | Tries to find an entity with the given identifier in the identity map of this UnitOfWork. | |
tryGetByIdHash ( string $idHash, string $rootClassName ) : mixed | INTERNAL: Tries to get an entity by its identifier hash. If no entity is found for the given hash, FALSE is returned. |
Method | Description | |
---|---|---|
cascadeDetach ( object $entity, array &$visited ) | Cascades a detach operation to associated entities. | |
cascadeMerge ( object $entity, object $managedCopy, array &$visited ) | Cascades a merge operation to associated entities. | |
cascadePersist ( object $entity, array &$visited ) | Cascades the save operation to associated entities. | |
cascadeRefresh ( object $entity, array &$visited ) | Cascades a refresh operation to associated entities. | |
cascadeRemove ( object $entity, array &$visited ) | Cascades the delete operation to associated entities. | |
computeAssociationChanges ( AssociationMapping $assoc, mixed $value ) | Computes the changes of an association. | |
doDetach ( object $entity, array &$visited ) | Executes a detach operation on the given entity. | |
doMerge ( object $entity, array &$visited, $prevManagedCopy = null, $assoc = null ) : object | Executes a merge operation on an entity. | |
doPersist ( object $entity, array &$visited ) | Persists an entity as part of the current unit of work. | |
doRefresh ( object $entity, array &$visited ) | Executes a refresh operation on an entity. | |
doRemove ( object $entity, array &$visited ) | Deletes an entity as part of the current unit of work. | |
executeDeletions ( Doctrine\ORM\Mapping\ClassMetadata $class ) | Executes all entity deletions for entities of the specified type. | |
executeExtraUpdates ( ) | Executes any extra updates that have been scheduled. | |
executeInserts ( Doctrine\ORM\Mapping\ClassMetadata $class ) | Executes all entity insertions for entities of the specified type. | |
executeUpdates ( Doctrine\ORM\Mapping\ClassMetadata $class ) | Executes all entity updates for entities of the specified type. | |
getCommitOrder ( array $entityChangeSet = null ) : array | Gets the commit order. | |
objToStr ( $obj ) | ||
persistNew ( $class, $entity ) |
public __construct ( |
||
$em |
public addToIdentityMap ( object $entity ) : boolean | ||
$entity | object | The entity to register. |
return | boolean | TRUE if the registration was successful, FALSE if the identity of the entity in question is already managed. |
public clearEntityChangeSet ( string $oid ) | ||
$oid | string | The entity's OID. |
public commit ( ) |
public computeChangeSet ( Doctrine\ORM\Mapping\ClassMetadata $class, object $entity ) | ||
$class | Doctrine\ORM\Mapping\ClassMetadata | The class descriptor of the entity. |
$entity | object | The entity for which to compute the changes. |
public computeChangeSets ( ) |
public getCollectionPersister ( array $association ) : AbstractCollectionPersister | ||
$association | array | |
return | AbstractCollectionPersister |
public getCommitOrderCalculator ( ) : Doctrine\ORM\Internal\CommitOrderCalculator | ||
return | Doctrine\ORM\Internal\CommitOrderCalculator |
public getEntityChangeSet ( $entity ) : array | ||
return | array |
public getEntityIdentifier ( object $entity ) : array | ||
$entity | object | |
return | array | The identifier values. |
public getEntityPersister ( string $entityName ) : Doctrine\ORM\Persister\AbstractEntityPersister | ||
$entityName | string | The name of the Entity. |
return | Doctrine\ORM\Persister\AbstractEntityPersister |
public getEntityState ( object $entity, integer $assume = null ) : integer | ||
$entity | object | |
$assume | integer | The state to assume if the state is not yet known (not MANAGED or REMOVED). This parameter can be set to improve performance of entity state detection by potentially avoiding a database lookup if the distinction between NEW and DETACHED is either known or does not matter for the caller of the method. |
return | integer | The entity state. |
public getIdentityMap ( ) : array | ||
return | array |
public getOriginalEntityData ( object $entity ) : array | ||
$entity | object | |
return | array |
public getScheduledCollectionDeletions ( ) : array | ||
return | array |
public getScheduledCollectionUpdates ( ) : array | ||
return | array |
public getScheduledEntityDeletions ( ) : array | ||
return | array |
public getScheduledEntityInsertions ( ) : array | ||
return | array |
public getScheduledEntityUpdates ( ) : array | ||
return | array |
public hasPendingInsertions ( ) : boolean | ||
return | boolean | TRUE if this UnitOfWork has pending insertions, FALSE otherwise. |
public isCollectionScheduledForDeletion ( Doctrine\ORM\PersistentCollection $coll ) | ||
$coll | Doctrine\ORM\PersistentCollection |
public isEntityScheduled ( $entity ) : boolean | ||
$entity | ||
return | boolean |
public isInIdentityMap ( object $entity ) : boolean | ||
$entity | object | |
return | boolean |
public isScheduledForDelete ( object $entity ) : boolean | ||
$entity | object | |
return | boolean |
public isScheduledForInsert ( object $entity ) : boolean | ||
$entity | object | |
return | boolean |
public isScheduledForUpdate ( object $entity ) : boolean | ||
$entity | object | |
return | boolean |
public loadCollection ( Doctrine\ORM\PersistentCollection $collection ) | ||
$collection | Doctrine\ORM\PersistentCollection | The collection to initialize. |
public propertyChanged ( object $entity, string $propertyName, mixed $oldValue, mixed $newValue ) | ||
$entity | object | The entity that owns the property. |
$propertyName | string | The name of the property that changed. |
$oldValue | mixed | The old value of the property. |
$newValue | mixed | The new value of the property. |
public recomputeSingleEntityChangeSet ( Doctrine\ORM\Mapping\ClassMetadata $class, object $entity ) | ||
$class | Doctrine\ORM\Mapping\ClassMetadata | The class descriptor of the entity. |
$entity | object | The entity for which to (re)calculate the change set. |
public removeFromIdentityMap ( object $entity ) : boolean | ||
$entity | object | |
return | boolean |
public scheduleCollectionDeletion ( Doctrine\ORM\PersistentCollection $coll ) | ||
$coll | Doctrine\ORM\PersistentCollection |
public scheduleExtraUpdate ( object $entity, array $changeset ) | ||
$entity | object | The entity for which to schedule an extra update. |
$changeset | array | The changeset of the entity (what to update). |
public scheduleForDelete ( object $entity ) | ||
$entity | object |
public scheduleForDirtyCheck ( object $entity ) | ||
$entity | object | The entity to schedule for dirty-checking. |
public scheduleForInsert ( object $entity ) | ||
$entity | object | The entity to schedule for insertion. |
public scheduleForUpdate ( object $entity ) | ||
$entity | object | The entity to schedule for being updated. |
public scheduleOrphanRemoval ( object $entity ) | ||
$entity | object |
public setOriginalEntityData ( $entity, array $data ) | ||
$data | array |
public tryGetById ( mixed $id, string $rootClassName ) : mixed | ||
$id | mixed | The entity identifier to look for. |
$rootClassName | string | The name of the root class of the mapped entity hierarchy. |
return | mixed | Returns the entity with the specified identifier if it exists in this UnitOfWork, FALSE otherwise. |