PHP 클래스 Doctrine\ODM\MongoDB\UnitOfWork

부터: 1.0
저자: Jonathan H. Wage ([email protected])
저자: Roman Borschel ([email protected])
파일 보기 프로젝트 열기: doctrine/mongodb-odm 1 사용 예제들

공개 메소드들

메소드 설명
__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

getScheduledCollectionUpdates() 공개 메소드

Gets the currently scheduled collection inserts, updates and deletes.

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.

getScheduledDocumentInsertions() 공개 메소드

Gets the currently scheduled document insertions in this UnitOfWork.

getScheduledDocumentUpdates() 공개 메소드

Gets the currently scheduled document updates in this UnitOfWork.

getScheduledDocumentUpserts() 공개 메소드

Gets the currently scheduled document upserts in this UnitOfWork.

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