PHP Класс Doctrine\ODM\MongoDB\UnitOfWork

С версии: 1.0
Автор: Jonathan H. Wage ([email protected])
Автор: Roman Borschel ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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 ( ClassMetadata $class, object $document ) 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, ClassMetadata $class ) : object 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 ( ) : CollectionPersister 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 ) : DocumentPersister 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 ( ) : PersistenceBuilder 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 ( ClassMetadata $class, object $document ) 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 ( ClassMetadata $class, object $document ) Schedules a document for insertion into the database.
scheduleForUpdate ( object $document ) Schedules a document for being updated.
scheduleForUpsert ( ClassMetadata $class, object $document ) 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, DocumentPersister $persister ) 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, ClassMetadata $class ) : mixed 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 ( ClassMetadata $class, object $document, boolean $recompute = false ) 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 ( ClassMetadata $class, array $documents, array $options = [] ) Executes all document deletions for documents of the specified type.
executeInserts ( ClassMetadata $class, array $documents, array $options = [] ) Executes all document insertions for documents of the specified type.
executeUpdates ( ClassMetadata $class, array $documents, array $options = [] ) Executes all document updates for documents of the specified type.
executeUpserts ( ClassMetadata $class, array $documents, array $options = [] ) Executes all document upserts for documents of the specified type.
fixPersistentCollectionOwnership ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll, object $document, ClassMetadata $class, string $propName ) : Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface 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 ( ClassMetadata $class, object $document )
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.

Описание методов

__construct() публичный Метод

Initializes a new UnitOfWork instance, bound to the given DocumentManager.
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

addToIdentityMap() публичный Метод

Note that documents in a hierarchy are registered with the class name of the root document. Identifiers are serialized before being used as array keys to allow differentiation of equal, but not identical, values.
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.

clear() публичный Метод

Clears the UnitOfWork.
public clear ( string | null $documentName = null )
$documentName string | null if given, only documents of this type will get detached.

clearDocumentChangeSet() публичный Метод

INTERNAL: Clears the property changeset of the document with the given OID.
public clearDocumentChangeSet ( string $oid )
$oid string The document's OID.

commit() публичный Метод

The operations are executed in the following order: 1) All document insertions 2) All document updates 3) All document deletions
public commit ( object $document = null, array $options = [] )
$document object
$options array Array of options to be used with batchInsert(), update() and remove()

computeChangeSet() публичный Метод

Modifies/populates the following properties: {@link originalDocumentData} If the document is NEW or MANAGED but not yet fully persisted (only has an id) then it was not fetched from the database and therefore we have no original document data yet. All of the current document data is stored as the original document data. {@link documentChangeSets} The changes detected on all properties of the document are stored there. A change is a tuple array where the first entry is the old value and the second entry is the new value of the property. Changesets are used by persisters to INSERT/UPDATE the persistent document state. {@link documentUpdates} If the document is already fully MANAGED (has been fetched from the database before) and any changes to its properties are detected, then a reference to the document is stored there to mark it for an update.
public computeChangeSet ( ClassMetadata $class, object $document )
$class Doctrine\ODM\MongoDB\Mapping\ClassMetadata The class descriptor of the document.
$document object The document for which to compute the changes.

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.
public computeChangeSets ( )

containsId() публичный Метод

INTERNAL: Checks whether an identifier exists in the identity map.
public containsId ( string $id, string $rootClassName ) : boolean
$id string
$rootClassName string
Результат boolean

detach() публичный Метод

Detaches a document from the persistence management. It's persistence will no longer be managed by Doctrine.
public detach ( object $document )
$document object The document to detach.

getById() публичный Метод

INTERNAL: Gets a document in the identity map by its identifier hash.
public getById ( mixed $id, ClassMetadata $class ) : object
$id mixed Document identifier
$class Doctrine\ODM\MongoDB\Mapping\ClassMetadata Document class
Результат object

getClassNameForAssociation() публичный Метод

Gets the class name for an association (embed or reference) with respect to any discriminator value.
public getClassNameForAssociation ( array $mapping, array | null $data ) : string
$mapping array Field mapping for the association
$data array | null Data for the embedded document or reference
Результат string Class name.

getCollectionPersister() публичный Метод

Get the collection persister instance.
public getCollectionPersister ( ) : CollectionPersister
Результат Doctrine\ODM\MongoDB\Persisters\CollectionPersister

getDocumentActualData() публичный Метод

Get a documents actual data, flattening all the objects to arrays.
public getDocumentActualData ( object $document ) : array
$document object
Результат array

getDocumentChangeSet() публичный Метод

Gets the changeset for a document.
public getDocumentChangeSet ( object $document ) : array
$document object
Результат array array('property' => array(0 => mixed|null, 1 => mixed|null))

getDocumentIdentifier() публичный Метод

Gets the identifier of a document.
public getDocumentIdentifier ( object $document ) : mixed
$document object
Результат mixed The identifier value

getDocumentPersister() публичный Метод

Get the document persister instance for the given document name
public getDocumentPersister ( string $documentName ) : DocumentPersister
$documentName string
Результат Doctrine\ODM\MongoDB\Persisters\DocumentPersister

getDocumentState() публичный Метод

Gets the state of a document with regard to the current unit of work.
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.

getIdentityMap() публичный Метод

Gets the identity map of the UnitOfWork.
public getIdentityMap ( ) : array
Результат array

getOrCreateDocument() публичный Метод

INTERNAL: Creates a document. Used for reconstitution of documents during hydration.
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.

getOriginalDocumentData() публичный Метод

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.
public getOriginalDocumentData ( object $document ) : array
$document object
Результат array

getOwningDocument() публичный Метод

If a top-level document is provided, that same document will be returned. For an embedded document, we will walk through parent associations until we find a top-level document.
public getOwningDocument ( object $document ) : object
$document object
Результат object

getParentAssociation() публичный Метод

list($mapping, $parent, $propertyPath) = $this->getParentAssociation($embeddedDocument);
public getParentAssociation ( object $document ) : array
$document object
Результат array $association

getPersistenceBuilder() публичный Метод

Factory for returning new PersistenceBuilder instances used for preparing data into queries for insert persistence.
public getPersistenceBuilder ( ) : PersistenceBuilder
Результат Doctrine\ODM\MongoDB\Persisters\PersistenceBuilder $pb

getScheduledCollectionDeletions() публичный Метод

Get the currently scheduled complete collection deletions
public getScheduledCollectionDeletions ( ) : array
Результат array

getScheduledCollectionUpdates() публичный Метод

Gets the currently scheduled collection inserts, updates and deletes.
public getScheduledCollectionUpdates ( ) : array
Результат array

getScheduledCollections() публичный Метод

INTERNAL: Gets PersistentCollections that are scheduled to update and related to $document
public getScheduledCollections ( object $document ) : array
$document object
Результат array

getScheduledDocumentDeletions() публичный Метод

Gets the currently scheduled document deletions in this UnitOfWork.
public getScheduledDocumentDeletions ( ) : array
Результат array

getScheduledDocumentInsertions() публичный Метод

Gets the currently scheduled document insertions in this UnitOfWork.
public getScheduledDocumentInsertions ( ) : array
Результат array

getScheduledDocumentUpdates() публичный Метод

Gets the currently scheduled document updates in this UnitOfWork.
public getScheduledDocumentUpdates ( ) : array
Результат array

getScheduledDocumentUpserts() публичный Метод

Gets the currently scheduled document upserts in this UnitOfWork.
public getScheduledDocumentUpserts ( ) : array
Результат array

getVisitedCollections() публичный Метод

INTERNAL: Gets PersistentCollections that have been visited during computing change set of $document
public getVisitedCollections ( object $document ) : Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface[]
$document object
Результат Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface[]

hasPendingInsertions() публичный Метод

Checks whether the UnitOfWork has any pending insertions.
public hasPendingInsertions ( ) : boolean
Результат boolean TRUE if this UnitOfWork has pending insertions, FALSE otherwise.

hasScheduledCollections() публичный Метод

Checks whether the document is related to a PersistentCollection scheduled for update or deletion.
public hasScheduledCollections ( object $document ) : boolean
$document object
Результат boolean

initializeObject() публичный Метод

Helper method to initialize a lazy loading proxy or persistent collection.
public initializeObject ( $obj ) : void
Результат void

isCollectionScheduledForDeletion() публичный Метод

Checks whether a PersistentCollection is scheduled for deletion.
public isCollectionScheduledForDeletion ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) : boolean
$coll Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface
Результат boolean

isCollectionScheduledForUpdate() публичный Метод

Checks whether a PersistentCollection is scheduled for update.
public isCollectionScheduledForUpdate ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll ) : boolean
$coll Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface
Результат boolean

isDocumentScheduled() публичный Метод

Checks whether a document is scheduled for insertion, update or deletion.
public isDocumentScheduled ( $document ) : boolean
$document
Результат boolean

isInIdentityMap() публичный Метод

Checks whether a document is registered in the identity map.
public isInIdentityMap ( object $document ) : boolean
$document object
Результат boolean

isScheduledForDelete() публичный Метод

Checks whether a document is registered as removed/deleted with the unit of work.
public isScheduledForDelete ( object $document ) : boolean
$document object
Результат boolean

isScheduledForDirtyCheck() публичный Метод

public isScheduledForDirtyCheck ( $document )

isScheduledForInsert() публичный Метод

Checks whether a document is scheduled for insertion.
public isScheduledForInsert ( object $document ) : boolean
$document object
Результат boolean

isScheduledForUpdate() публичный Метод

Note: Is not very useful currently as dirty documents are only registered at commit time.
public isScheduledForUpdate ( object $document ) : boolean
$document object
Результат boolean

isScheduledForUpsert() публичный Метод

Checks whether a document is scheduled for upsert.
public isScheduledForUpsert ( object $document ) : boolean
$document object
Результат boolean

loadCollection() публичный Метод

Initializes (loads) an uninitialized persistent collection of a document.
public loadCollection ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $collection )
$collection Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface The collection to initialize.

lock() публичный Метод

Acquire a lock on the given document.
public lock ( object $document, integer $lockMode, integer $lockVersion = null )
$document object
$lockMode integer
$lockVersion integer

merge() публичный Метод

Merges the state of the given detached document into this UnitOfWork.
public merge ( object $document ) : object
$document object
Результат object The managed copy of the document.

persist() публичный Метод

Persists a document as part of the current unit of work.
public persist ( object $document )
$document object The document to persist.

propertyChanged() публичный Метод

Notifies this UnitOfWork of a property change in a document.
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.

recomputeSingleDocumentChangeSet() публичный Метод

The passed document must be a managed document. If the document already has a change set because this method is invoked during a commit cycle then the change sets are added. whereby changes detected in this method prevail.
public recomputeSingleDocumentChangeSet ( ClassMetadata $class, object $document )
$class Doctrine\ODM\MongoDB\Mapping\ClassMetadata The class descriptor of the document.
$document object The document for which to (re)calculate the change set.

refresh() публичный Метод

Refreshes the state of the given document from the database, overwriting any local, unpersisted changes.
public refresh ( object $document )
$document object The document to refresh.

registerManaged() публичный Метод

TODO: This method assumes that $id is a valid PHP identifier for the document class. If the class expects its database identifier to be a MongoId, and an incompatible $id is registered (e.g. an integer), the document identifiers map will become inconsistent with the identity map. In the future, we may want to round-trip $id through a PHP and database conversion and throw an exception if it's inconsistent.
public registerManaged ( object $document, array $id, array $data )
$document object The document.
$id array The identifier values.
$data array The original document data.

remove() публичный Метод

Deletes a document as part of the current unit of work.
public remove ( object $document )
$document object The document to remove.

removeFromIdentityMap() публичный Метод

INTERNAL: Removes a document from the identity map. This effectively detaches the document from the persistence management of Doctrine.
public removeFromIdentityMap ( object $document ) : boolean
$document object
Результат boolean

scheduleCollectionDeletion() публичный Метод

INTERNAL: Schedules a complete collection for removal when this UnitOfWork commits.
public scheduleCollectionDeletion ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll )
$coll Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface

scheduleCollectionUpdate() публичный Метод

INTERNAL: Schedules a collection for update when this UnitOfWork commits.
public scheduleCollectionUpdate ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll )
$coll Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface

scheduleForDelete() публичный Метод

INTERNAL: Schedules a document for deletion.
public scheduleForDelete ( object $document )
$document object

scheduleForDirtyCheck() публичный Метод

Schedules a document for dirty-checking at commit-time.
public scheduleForDirtyCheck ( object $document )
$document object The document to schedule for dirty-checking.

scheduleForInsert() публичный Метод

If the document already has an identifier, it will be added to the identity map.
public scheduleForInsert ( ClassMetadata $class, object $document )
$class Doctrine\ODM\MongoDB\Mapping\ClassMetadata
$document object The document to schedule for insertion.

scheduleForUpdate() публичный Метод

Schedules a document for being updated.
public scheduleForUpdate ( object $document )
$document object The document to schedule for being updated.

scheduleForUpsert() публичный Метод

Schedules a document for upsert into the database and adds it to the identity map
public scheduleForUpsert ( ClassMetadata $class, object $document )
$class Doctrine\ODM\MongoDB\Mapping\ClassMetadata
$document object The document to schedule for upsert.

scheduleOrphanRemoval() публичный Метод

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.
public scheduleOrphanRemoval ( object $document )
$document object

setDocumentChangeSet() публичный Метод

INTERNAL: Sets the changeset for a document.
public setDocumentChangeSet ( object $document, array $changeset )
$document object
$changeset array

setDocumentPersister() публичный Метод

Set the document persister instance to use for the given document name
public setDocumentPersister ( string $documentName, DocumentPersister $persister )
$documentName string
$persister Doctrine\ODM\MongoDB\Persisters\DocumentPersister

setOriginalDocumentData() публичный Метод

public setOriginalDocumentData ( $document, array $data )
$data array

setOriginalDocumentProperty() публичный Метод

INTERNAL: Sets a property value of the original data array of a document.
public setOriginalDocumentProperty ( string $oid, string $property, mixed $value )
$oid string
$property string
$value mixed

setParentAssociation() публичный Метод

Sets the parent association for a given embedded document.
public setParentAssociation ( object $document, array $mapping, object $parent, string $propertyPath )
$document object
$mapping array
$parent object
$propertyPath string

size() публичный Метод

Calculates the size of the UnitOfWork. The size of the UnitOfWork is the number of documents in the identity map.
public size ( ) : integer
Результат integer

tryGetById() публичный Метод

INTERNAL: Tries to get a document by its identifier hash. If no document is found for the given hash, FALSE is returned.
public tryGetById ( mixed $id, ClassMetadata $class ) : mixed
$id mixed Document identifier
$class Doctrine\ODM\MongoDB\Mapping\ClassMetadata Document class
Результат mixed The found document or FALSE.

unlock() публичный Метод

Releases a lock on the given document.
public unlock ( object $document )
$document object

unscheduleCollectionDeletion() публичный Метод

INTERNAL: Unschedules a collection from being deleted when this UnitOfWork commits.
public unscheduleCollectionDeletion ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll )
$coll Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface

unscheduleCollectionUpdate() публичный Метод

INTERNAL: Unschedules a collection from being updated when this UnitOfWork commits.
public unscheduleCollectionUpdate ( Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface $coll )
$coll Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface

unscheduleOrphanRemoval() публичный Метод

INTERNAL: Unschedules an embedded or referenced object for removal.
public unscheduleOrphanRemoval ( object $document )
$document object