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.
|DocumentPersister||The DocumentPersister is responsible for persisting documents.|
PersistenceBuilder builds the queries used by the persisters to update and insert documents when a DocumentManager is flushed. It uses the changeset information in the UnitOfWork to build queries using atomic operators like $set, $unset, etc.