示例#1
0
 /**
  * Executes all document updates for documents of the specified type.
  *
  * @param Mapping\ClassMetadata $class
  * @param array $documents Array of documents to update
  * @param array $options Array of options to be used with update()
  */
 private function executeUpdates(ClassMetadata $class, array $documents, array $options = array())
 {
     $className = $class->name;
     $persister = $this->getDocumentPersister($className);
     foreach ($documents as $oid => $document) {
         $this->lifecycleEventManager->preUpdate($class, $document);
         if (!empty($this->documentChangeSets[$oid]) || $this->hasScheduledCollections($document)) {
             $persister->update($document, $options);
         }
         unset($this->documentUpdates[$oid]);
         $this->lifecycleEventManager->postUpdate($class, $document);
     }
 }