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(PersistentCollectionInterface $coll, array $options)

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

update(PersistentCollectionInterface $coll, array $options)

Updates a PersistentCollection instance deleting removed rows and inserting new rows.

Details

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

delete(PersistentCollectionInterface $coll, array $options)

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

Parameters

PersistentCollectionInterface $coll
array $options

update(PersistentCollectionInterface $coll, array $options)

Updates a PersistentCollection instance deleting removed rows and inserting new rows.

Parameters

PersistentCollectionInterface $coll
array $options