Commit() final public method

Commits the supplied operations to the underlying database within a transactional scope.
final public Commit ( array $EntitiesToPersist, array $ProceduresToExecute, array $EntitiesToDiscard, array $CriteriaToDiscard ) : void
$EntitiesToPersist array The entities to persist
$ProceduresToExecute array The procedures to execute
$EntitiesToDiscard array The entities to discard
$CriteriaToDiscard array The criteria of entities to discard
return void
コード例 #1
0
ファイル: Repository.php プロジェクト: timetoogo/penumbra
 /**
  * Commits all specified changes to the underlying DomainDatabaseMap.
  * 
  * @return void
  */
 public function SaveChanges()
 {
     if (count($this->PersistedQueue) === 0 && count($this->ExecutionQueue) === 0 && count($this->DiscardedQueue) === 0 && count($this->DiscardedCriterionQueue) === 0) {
         return;
     }
     $this->DomainDatabaseMap->Commit($this->PersistedQueue, $this->ExecutionQueue, $this->DiscardedQueue, $this->DiscardedCriterionQueue);
     $this->ClearChanges();
 }
コード例 #2
0
ファイル: Storm.php プロジェクト: timetoogo/penumbra
 /**
  * Saves all the changes from the repositories
  * instantiated by this storm.
  * 
  * @return void
  */
 public final function SaveChanges()
 {
     $PersistedQueues = [];
     $ExecutionQueues = [];
     $DiscardedQueues = [];
     $DiscardedCriterionQueues = [];
     foreach ($this->Repositories as $Repository) {
         list($PersistedQueue, $ExecutionQueue, $DiscardedQueue, $DiscardedCriterionQueue) = $Repository->GetChanges();
         $PersistedQueues[] = $PersistedQueue;
         $ExecutionQueues[] = $ExecutionQueue;
         $DiscardedQueues[] = $DiscardedQueue;
         $DiscardedCriterionQueues[] = $DiscardedCriterionQueue;
         $Repository->ClearChanges();
     }
     $PersistedQueue = call_user_func_array('array_merge', $PersistedQueues);
     $ExecutionQueue = call_user_func_array('array_merge', $ExecutionQueues);
     $DiscardedQueue = call_user_func_array('array_merge', $DiscardedQueues);
     $DiscardedCriterionQueue = call_user_func_array('array_merge', $DiscardedCriterionQueues);
     $this->DomainDatabaseMap->Commit($PersistedQueue, $ExecutionQueue, $DiscardedQueue, $DiscardedCriterionQueue);
 }