interface PersistentCollectionInterface implements Collection (View source)

Interface for persistent collection classes.

Methods

setDocumentManager(DocumentManager $dm)

Sets the document manager and unit of work (used during merge operations).

setMongoData(array $mongoData)

Sets the array of raw mongo data that will be used to initialize this collection.

array
getMongoData()

Gets the array of raw mongo data that will be used to initialize this collection.

setHints(array $hints)

Set hints to account for during reconstitution/lookup of the documents.

array
getHints()

Get hints to account for during reconstitution/lookup of the documents.

initialize()

Initializes the collection by loading its contents from the database if the collection is not yet initialized.

boolean
isDirty()

Gets a boolean flag indicating whether this collection is dirty which means its state needs to be synchronized with the database.

setDirty(boolean $dirty)

Sets a boolean flag, indicating whether this collection is dirty.

setOwner(object $document, array $mapping)

INTERNAL: Sets the collection's owning entity together with the AssociationMapping that describes the association between the owner and the elements of the collection.

takeSnapshot()

INTERNAL: Tells this collection to take a snapshot of its current state reindexing itself numerically if using save strategy that is enforcing BSON array.

clearSnapshot()

INTERNAL: Clears the internal snapshot information and sets isDirty to true if the collection has elements.

array
getSnapshot()

INTERNAL: Returns the last snapshot of the elements in the collection.

array
getDeleteDiff()

INTERNAL: getDeleteDiff

array
getDeletedDocuments()

INTERNAL: get objects that were removed, unlike getDeleteDiff this doesn't care about indices.

array
getInsertDiff()

INTERNAL: getInsertDiff

array
getInsertedDocuments()

INTERNAL: get objects that were added, unlike getInsertDiff this doesn't care about indices.

object
getOwner()

INTERNAL: Gets the collection owner.

array
getMapping()

No description

ClassMetadata
getTypeClass()

No description

setInitialized(boolean $bool)

Sets the initialized flag of the collection, forcing it into that state.

boolean
isInitialized()

Checks whether this collection has been initialized.

Collection
unwrap()

Returns the wrapped Collection instance.

Details

setDocumentManager(DocumentManager $dm)

Sets the document manager and unit of work (used during merge operations).

Parameters

DocumentManager $dm

setMongoData(array $mongoData)

Sets the array of raw mongo data that will be used to initialize this collection.

Parameters

array $mongoData

array getMongoData()

Gets the array of raw mongo data that will be used to initialize this collection.

Return Value

array $mongoData

setHints(array $hints)

Set hints to account for during reconstitution/lookup of the documents.

Parameters

array $hints

array getHints()

Get hints to account for during reconstitution/lookup of the documents.

Return Value

array $hints

initialize()

Initializes the collection by loading its contents from the database if the collection is not yet initialized.

boolean isDirty()

Gets a boolean flag indicating whether this collection is dirty which means its state needs to be synchronized with the database.

Return Value

boolean TRUE if the collection is dirty, FALSE otherwise.

setDirty(boolean $dirty)

Sets a boolean flag, indicating whether this collection is dirty.

Parameters

boolean $dirty Whether the collection should be marked dirty or not.

setOwner(object $document, array $mapping)

INTERNAL: Sets the collection's owning entity together with the AssociationMapping that describes the association between the owner and the elements of the collection.

Parameters

object $document
array $mapping

takeSnapshot()

INTERNAL: Tells this collection to take a snapshot of its current state reindexing itself numerically if using save strategy that is enforcing BSON array.

Reindexing is safe as snapshot is taken only after synchronizing collection with database or clearing it.

clearSnapshot()

INTERNAL: Clears the internal snapshot information and sets isDirty to true if the collection has elements.

array getSnapshot()

INTERNAL: Returns the last snapshot of the elements in the collection.

Return Value

array The last snapshot of the elements.

array getDeleteDiff()

INTERNAL: getDeleteDiff

Return Value

array

array getDeletedDocuments()

INTERNAL: get objects that were removed, unlike getDeleteDiff this doesn't care about indices.

Return Value

array

array getInsertDiff()

INTERNAL: getInsertDiff

Return Value

array

array getInsertedDocuments()

INTERNAL: get objects that were added, unlike getInsertDiff this doesn't care about indices.

Return Value

array

object getOwner()

INTERNAL: Gets the collection owner.

Return Value

object

array getMapping()

Return Value

array

ClassMetadata getTypeClass()

Return Value

ClassMetadata

Exceptions

MongoDBException

setInitialized(boolean $bool)

Sets the initialized flag of the collection, forcing it into that state.

Parameters

boolean $bool

boolean isInitialized()

Checks whether this collection has been initialized.

Return Value

boolean

Collection unwrap()

Returns the wrapped Collection instance.

Return Value

Collection