示例#1
0
 /**
  * Commits new objects and changes to objects in the current persistence
  * session into the backend
  *
  * @return void
  * @api
  */
 public function persistAll()
 {
     // hand in only aggregate roots, leaving handling of subobjects to
     // the underlying storage layer
     // reconstituted entities must be fetched from the session and checked
     // for changes by the underlying backend as well!
     $this->backend->setAggregateRootObjects($this->addedObjects);
     $this->backend->setChangedEntities($this->changedObjects);
     $this->backend->setDeletedEntities($this->removedObjects);
     $this->backend->commit();
     $this->addedObjects = new \SplObjectStorage();
     $this->removedObjects = new \SplObjectStorage();
     $this->changedObjects = new \SplObjectStorage();
     $this->emitAllObjectsPersisted();
 }