private function getAtomicCollectionUpdateQuery($document)
{
$update = array();
$collections = $this->uow->getScheduledCollections($document);
$collPersister = $this->uow->getCollectionPersister();
foreach ($collections as $coll) {
/* @var $coll PersistentCollection */
$mapping = $coll->getMapping();
if ($mapping['strategy'] !== "atomicSet" && $mapping['strategy'] !== "atomicSetArray") {
continue;
}
if ($this->uow->isCollectionScheduledForUpdate($coll)) {
$update = array_merge_recursive($update, $collPersister->prepareSetQuery($coll));
$this->uow->unscheduleCollectionUpdate($coll);
/* TODO:
* Collection can be set for both deletion and update if
* PersistentCollection instance was changed. Since we're dealing
* with collection update in one query we won't need the $unset.
* Line can be removed once the issue is fixed.
*/
$this->uow->unscheduleCollectionDeletion($coll);
} elseif ($this->uow->isCollectionScheduledForDeletion($coll)) {
$update = array_merge_recursive($update, $collPersister->prepareDeleteQuery($coll));
$this->uow->unscheduleCollectionDeletion($coll);
}
}
return $update;
}