class CollectionPersister (View source)

The CollectionPersister is responsible for persisting collections of embedded or referenced documents. When a PersistentCollection is scheduledForDeletion in the UnitOfWork by calling PersistentCollection::clear() or is de-referenced in the domain application code, CollectionPersister::delete() will be called. When documents within the PersistentCollection are added or removed, CollectionPersister::update() will be called, which may set the entire collection or delete/insert individual elements, depending on the mapping strategy.

Methods

__construct(DocumentManager $dm, PersistenceBuilder $pb, UnitOfWork $uow)

No description

delete(object $parent, array $collections, array $options)

Deletes a PersistentCollection instances completely from a document using $unset.

update(object $parent, array $collections, array $options)

Updates a list PersistentCollection instances deleting removed rows and inserting new rows.

Details

__construct(DocumentManager $dm, PersistenceBuilder $pb, UnitOfWork $uow)

delete(object $parent, array $collections, array $options)

Deletes a PersistentCollection instances completely from a document using $unset.

Parameters

object $parent
array $collections
array $options

update(object $parent, array $collections, array $options)

Updates a list PersistentCollection instances deleting removed rows and inserting new rows.

Parameters

object $parent
array $collections
array $options