Метод | Описание | |
---|---|---|
__construct ( DocumentManager $dm, Doctrine\Common\EventManager $evm, Doctrine\ODM\MongoDB\Hydrator\HydratorFactory $hydratorFactory ) | Initializes a new UnitOfWork instance, bound to the given DocumentManager. | |
addToIdentityMap ( object $document ) : boolean | INTERNAL: Registers a document in the identity map. | |
clear ( string | null $documentName = null ) | Clears the UnitOfWork. | |
clearDocumentChangeSet ( string $oid ) | INTERNAL: Clears the property changeset of the document with the given OID. | |
commit ( object $document = null, array $options = [] ) | Commits the UnitOfWork, executing all operations that have been postponed up to this point. The state of all managed documents will be synchronized with the database. | |
computeChangeSet ( |
Computes the changes that happened to a single document. | |
computeChangeSets ( ) | Computes all the changes that have been done to documents and collections since the last commit and stores these changes in the _documentChangeSet map temporarily for access by the persisters, until the UoW commit is finished. | |
containsId ( string $id, string $rootClassName ) : boolean | INTERNAL: Checks whether an identifier exists in the identity map. | |
detach ( object $document ) | Detaches a document from the persistence management. It's persistence will no longer be managed by Doctrine. | |
getById ( mixed $id, |
INTERNAL: Gets a document in the identity map by its identifier hash. | |
getClassNameForAssociation ( array $mapping, array | null $data ) : string | Gets the class name for an association (embed or reference) with respect to any discriminator value. | |
getCollectionPersister ( ) : |
Get the collection persister instance. | |
getDocumentActualData ( object $document ) : array | Get a documents actual data, flattening all the objects to arrays. | |
getDocumentChangeSet ( object $document ) : array | Gets the changeset for a document. | |
getDocumentIdentifier ( object $document ) : mixed | Gets the identifier of a document. | |
getDocumentPersister ( string $documentName ) : |
Get the document persister instance for the given document name | |
getDocumentState ( object $document, integer | null $assume = null ) : integer | Gets the state of a document with regard to the current unit of work. | |
getIdentityMap ( ) : array | Gets the identity map of the UnitOfWork. | |
getOrCreateDocument ( string $className, array $data, array &$hints = [], object $document = null ) : object | INTERNAL: Creates a document. Used for reconstitution of documents during hydration. | |
getOriginalDocumentData ( object $document ) : array | Gets the original data of a document. The original data is the data that was present at the time the document was reconstituted from the database. | |
getOwningDocument ( object $document ) : object | Get the top-most owning document of a given document | |
getParentAssociation ( object $document ) : array | Gets the parent association for a given embedded document. | |
getPersistenceBuilder ( ) : |
Factory for returning new PersistenceBuilder instances used for preparing data into queries for insert persistence. | |
getScheduledCollectionDeletions ( ) : array | Get the currently scheduled complete collection deletions | |
getScheduledCollectionUpdates ( ) : array | Gets the currently scheduled collection inserts, updates and deletes. | |
getScheduledCollections ( object $document ) : array | INTERNAL: Gets PersistentCollections that are scheduled to update and related to $document | |
getScheduledDocumentDeletions ( ) : array | Gets the currently scheduled document deletions in this UnitOfWork. | |
getScheduledDocumentInsertions ( ) : array | Gets the currently scheduled document insertions in this UnitOfWork. | |
getScheduledDocumentUpdates ( ) : array | Gets the currently scheduled document updates in this UnitOfWork. | |
getScheduledDocumentUpserts ( ) : array | Gets the currently scheduled document upserts in this UnitOfWork. | |
getVisitedCollections ( object $document ) : Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface[] | INTERNAL: Gets PersistentCollections that have been visited during computing change set of $document | |
hasPendingInsertions ( ) : boolean | Checks whether the UnitOfWork has any pending insertions. | |
hasScheduledCollections ( object $document ) : boolean | Checks whether the document is related to a PersistentCollection scheduled for update or deletion. | |
initializeObject ( $obj ) : void | Helper method to initialize a lazy loading proxy or persistent collection. | |
isCollectionScheduledForDeletion ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) : boolean | Checks whether a PersistentCollection is scheduled for deletion. | |
isCollectionScheduledForUpdate ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) : boolean | Checks whether a PersistentCollection is scheduled for update. | |
isDocumentScheduled ( $document ) : boolean | Checks whether a document is scheduled for insertion, update or deletion. | |
isInIdentityMap ( object $document ) : boolean | Checks whether a document is registered in the identity map. | |
isScheduledForDelete ( object $document ) : boolean | Checks whether a document is registered as removed/deleted with the unit of work. | |
isScheduledForDirtyCheck ( $document ) | ||
isScheduledForInsert ( object $document ) : boolean | Checks whether a document is scheduled for insertion. | |
isScheduledForUpdate ( object $document ) : boolean | Checks whether a document is registered as dirty in the unit of work. | |
isScheduledForUpsert ( object $document ) : boolean | Checks whether a document is scheduled for upsert. | |
loadCollection ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $collection ) | Initializes (loads) an uninitialized persistent collection of a document. | |
lock ( object $document, integer $lockMode, integer $lockVersion = null ) | Acquire a lock on the given document. | |
merge ( object $document ) : object | Merges the state of the given detached document into this UnitOfWork. | |
persist ( object $document ) | Persists a document as part of the current unit of work. | |
propertyChanged ( object $document, string $propertyName, mixed $oldValue, mixed $newValue ) | Notifies this UnitOfWork of a property change in a document. | |
recomputeSingleDocumentChangeSet ( |
INTERNAL: Computes the changeset of an individual document, independently of the computeChangeSets() routine that is used at the beginning of a UnitOfWork#commit(). | |
refresh ( object $document ) | Refreshes the state of the given document from the database, overwriting any local, unpersisted changes. | |
registerManaged ( object $document, array $id, array $data ) | INTERNAL: Registers a document as managed. | |
remove ( object $document ) | Deletes a document as part of the current unit of work. | |
removeFromIdentityMap ( object $document ) : boolean | INTERNAL: Removes a document from the identity map. This effectively detaches the document from the persistence management of Doctrine. | |
scheduleCollectionDeletion ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) | INTERNAL: Schedules a complete collection for removal when this UnitOfWork commits. | |
scheduleCollectionUpdate ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) | INTERNAL: Schedules a collection for update when this UnitOfWork commits. | |
scheduleForDelete ( object $document ) | INTERNAL: Schedules a document for deletion. | |
scheduleForDirtyCheck ( object $document ) | Schedules a document for dirty-checking at commit-time. | |
scheduleForInsert ( |
Schedules a document for insertion into the database. | |
scheduleForUpdate ( object $document ) | Schedules a document for being updated. | |
scheduleForUpsert ( |
Schedules a document for upsert into the database and adds it to the identity map | |
scheduleOrphanRemoval ( object $document ) | INTERNAL: Schedules an embedded document for removal. The remove() operation will be invoked on that document at the beginning of the next commit of this UnitOfWork. | |
setDocumentChangeSet ( object $document, array $changeset ) | INTERNAL: Sets the changeset for a document. | |
setDocumentPersister ( string $documentName, |
Set the document persister instance to use for the given document name | |
setOriginalDocumentData ( $document, array $data ) | ||
setOriginalDocumentProperty ( string $oid, string $property, mixed $value ) | INTERNAL: Sets a property value of the original data array of a document. | |
setParentAssociation ( object $document, array $mapping, object $parent, string $propertyPath ) | Sets the parent association for a given embedded document. | |
size ( ) : integer | Calculates the size of the UnitOfWork. The size of the UnitOfWork is the number of documents in the identity map. | |
tryGetById ( mixed $id, |
INTERNAL: Tries to get a document by its identifier hash. If no document is found for the given hash, FALSE is returned. | |
unlock ( object $document ) | Releases a lock on the given document. | |
unscheduleCollectionDeletion ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) | INTERNAL: Unschedules a collection from being deleted when this UnitOfWork commits. | |
unscheduleCollectionUpdate ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) | INTERNAL: Unschedules a collection from being updated when this UnitOfWork commits. | |
unscheduleOrphanRemoval ( object $document ) | INTERNAL: Unschedules an embedded or referenced object for removal. |
Метод | Описание | |
---|---|---|
cascadeDetach ( object $document, array &$visited ) | Cascades a detach operation to associated documents. | |
cascadeMerge ( object $document, object $managedCopy, array &$visited ) | Cascades a merge operation to associated documents. | |
cascadePersist ( object $document, array &$visited ) | Cascades the save operation to associated documents. | |
cascadeRefresh ( object $document, array &$visited ) | Cascades a refresh operation to associated documents. | |
cascadeRemove ( object $document, array &$visited ) | Cascades the delete operation to associated documents. | |
computeAssociationChanges ( object $parentDocument, array $assoc, mixed $value ) | Computes the changes of an association. | |
computeOrRecomputeChangeSet ( |
Used to do the common work of computeChangeSet and recomputeSingleDocumentChangeSet | |
computeScheduleInsertsChangeSets ( ) | Compute changesets of all documents scheduled for insertion. | |
computeScheduleUpsertsChangeSets ( ) | Compute changesets of all documents scheduled for upsert. | |
computeSingleDocumentChangeSet ( object $document ) : void | Only flush the given document according to a ruleset that keeps the UoW consistent. | |
doDetach ( object $document, array &$visited ) | Executes a detach operation on the given document. | |
doMerge ( object $document, array &$visited, object | null $prevManagedCopy = null, array | null $assoc = null ) : object | Executes a merge operation on a document. | |
doPersist ( object $document, array &$visited ) | Saves a document as part of the current unit of work. | |
doRefresh ( object $document, array &$visited ) | Executes a refresh operation on a document. | |
doRemove ( object $document, array &$visited ) | Deletes a document as part of the current unit of work. | |
executeDeletions ( |
Executes all document deletions for documents of the specified type. | |
executeInserts ( |
Executes all document insertions for documents of the specified type. | |
executeUpdates ( |
Executes all document updates for documents of the specified type. | |
executeUpserts ( |
Executes all document upserts for documents of the specified type. | |
fixPersistentCollectionOwnership ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll, object $document, |
Fixes PersistentCollection state if it wasn't used exactly as we had in mind: 1) sets owner if it was cloned 2) clones collection, sets owner, updates document's property and, if necessary, updates originalData 3) NOP if state is OK Returned collection should be used from now on (only important with 2nd point) | |
getClassesForCommitAction ( array $documents, boolean $includeEmbedded = false ) : array | Groups a list of scheduled documents by their class. | |
getIdForIdentityMap ( object $document ) : string | ||
objToStr ( $obj ) | ||
persistNew ( |
||
scheduleCollectionOwner ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) | Marks the PersistentCollection's top-level owner as having a relation to a collection scheduled for update or deletion. |
public __construct ( DocumentManager $dm, Doctrine\Common\EventManager $evm, Doctrine\ODM\MongoDB\Hydrator\HydratorFactory $hydratorFactory ) | ||
$dm | DocumentManager | |
$evm | Doctrine\Common\EventManager | |
$hydratorFactory | Doctrine\ODM\MongoDB\Hydrator\HydratorFactory |
public addToIdentityMap ( object $document ) : boolean | ||
$document | object | The document to register. |
Результат | boolean | TRUE if the registration was successful, FALSE if the identity of the document in question is already managed. |
public clearDocumentChangeSet ( string $oid ) | ||
$oid | string | The document's OID. |
public computeChangeSet ( |
||
$class | The class descriptor of the document. | |
$document | object | The document for which to compute the changes. |
public computeChangeSets ( ) |
public getCollectionPersister ( ) : |
||
Результат |
public getDocumentActualData ( object $document ) : array | ||
$document | object | |
Результат | array |
public getDocumentChangeSet ( object $document ) : array | ||
$document | object | |
Результат | array | array('property' => array(0 => mixed|null, 1 => mixed|null)) |
public getDocumentIdentifier ( object $document ) : mixed | ||
$document | object | |
Результат | mixed | The identifier value |
public getDocumentPersister ( string $documentName ) : |
||
$documentName | string | |
Результат |
public getDocumentState ( object $document, integer | null $assume = null ) : integer | ||
$document | object | |
$assume | integer | null | The state to assume if the state is not yet known (not MANAGED or REMOVED). This parameter can be set to improve performance of document 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. |
Результат | integer | The document state. |
public getIdentityMap ( ) : array | ||
Результат | array |
public getOrCreateDocument ( string $className, array $data, array &$hints = [], object $document = null ) : object | ||
$className | string | The name of the document class. |
$data | array | The data for the document. |
$hints | array | Any hints to account for during reconstitution/lookup of the document. |
$document | object | The document to be hydrated into in case of creation |
Результат | object | The document instance. |
public getOriginalDocumentData ( object $document ) : array | ||
$document | object | |
Результат | array |
public getOwningDocument ( object $document ) : object | ||
$document | object | |
Результат | object |
list($mapping, $parent, $propertyPath) = $this->getParentAssociation($embeddedDocument);
public getParentAssociation ( object $document ) : array | ||
$document | object | |
Результат | array | $association |
public getPersistenceBuilder ( ) : |
||
Результат | $pb |
public getScheduledCollectionDeletions ( ) : array | ||
Результат | array |
public getScheduledCollectionUpdates ( ) : array | ||
Результат | array |
public getScheduledCollections ( object $document ) : array | ||
$document | object | |
Результат | array |
public getScheduledDocumentDeletions ( ) : array | ||
Результат | array |
public getScheduledDocumentInsertions ( ) : array | ||
Результат | array |
public getScheduledDocumentUpdates ( ) : array | ||
Результат | array |
public getScheduledDocumentUpserts ( ) : array | ||
Результат | array |
public getVisitedCollections ( object $document ) : Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface[] | ||
$document | object | |
Результат | Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface[] |
public hasPendingInsertions ( ) : boolean | ||
Результат | boolean | TRUE if this UnitOfWork has pending insertions, FALSE otherwise. |
public hasScheduledCollections ( object $document ) : boolean | ||
$document | object | |
Результат | boolean |
public initializeObject ( $obj ) : void | ||
Результат | void |
public isCollectionScheduledForDeletion ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) : boolean | ||
$coll | Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface | |
Результат | boolean |
public isCollectionScheduledForUpdate ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) : boolean | ||
$coll | Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface | |
Результат | boolean |
public isDocumentScheduled ( $document ) : boolean | ||
$document | ||
Результат | boolean |
public isInIdentityMap ( object $document ) : boolean | ||
$document | object | |
Результат | boolean |
public isScheduledForDelete ( object $document ) : boolean | ||
$document | object | |
Результат | boolean |
public isScheduledForInsert ( object $document ) : boolean | ||
$document | object | |
Результат | boolean |
public isScheduledForUpdate ( object $document ) : boolean | ||
$document | object | |
Результат | boolean |
public isScheduledForUpsert ( object $document ) : boolean | ||
$document | object | |
Результат | boolean |
public loadCollection ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $collection ) | ||
$collection | Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface | The collection to initialize. |
public propertyChanged ( object $document, string $propertyName, mixed $oldValue, mixed $newValue ) | ||
$document | object | The document 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 recomputeSingleDocumentChangeSet ( |
||
$class | The class descriptor of the document. | |
$document | object | The document for which to (re)calculate the change set. |
public removeFromIdentityMap ( object $document ) : boolean | ||
$document | object | |
Результат | boolean |
public scheduleCollectionDeletion ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) | ||
$coll | Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface |
public scheduleCollectionUpdate ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) | ||
$coll | Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface |
public scheduleForDelete ( object $document ) | ||
$document | object |
public scheduleForDirtyCheck ( object $document ) | ||
$document | object | The document to schedule for dirty-checking. |
public scheduleForInsert ( |
||
$class | ||
$document | object | The document to schedule for insertion. |
public scheduleForUpdate ( object $document ) | ||
$document | object | The document to schedule for being updated. |
public scheduleForUpsert ( |
||
$class | ||
$document | object | The document to schedule for upsert. |
public scheduleOrphanRemoval ( object $document ) | ||
$document | object |
public setDocumentChangeSet ( object $document, array $changeset ) | ||
$document | object | |
$changeset | array |
public setDocumentPersister ( string $documentName, |
||
$documentName | string | |
$persister |
public setOriginalDocumentData ( $document, array $data ) | ||
$data | array |
public tryGetById ( mixed $id, |
||
$id | mixed | Document identifier |
$class | Document class | |
Результат | mixed | The found document or FALSE. |
public unscheduleCollectionDeletion ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) | ||
$coll | Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface |
public unscheduleCollectionUpdate ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) | ||
$coll | Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface |
public unscheduleOrphanRemoval ( object $document ) | ||
$document | object |