The databse represents a group of tables, their columns and relations.
Author: Elliot Levin (elliot@aanet.com.au)
Inheritance: use trait Storm\Core\Helpers\Type
 /**
  * Commits the supplied operations to the underlying database within a transactional scope.
  * 
  * @param array $EntitiesToPersist The entities to persist
  * @param array $ProceduresToExecute The procedures to execute
  * @param array $EntitiesToDiscard The entities to discard
  * @param array $CriteriaToDiscard The criteria of entities to discard
  * @return void
  */
 public final function Commit(array $EntitiesToPersist, array $ProceduresToExecute, array $EntitiesToDiscard, array $CriteriaToDiscard)
 {
     $UnitOfWork = $this->Domain->BuildUnitOfWork($EntitiesToPersist, $ProceduresToExecute, $EntitiesToDiscard, $CriteriaToDiscard);
     $Transaction = new Relational\Transaction();
     $this->MapUnitOfWorkToTransaction($UnitOfWork, $Transaction);
     $this->Database->Commit($Transaction);
 }
Beispiel #2
0
 protected function OnStructureInitialized(Relational\Database $Database)
 {
     $Registrar = new Containers\Registrar(StructuralTableTrait::GetType());
     $PrimaryKeyColumns = $this->GetPrimaryKeyColumns();
     if (count($PrimaryKeyColumns) > 0) {
         $Registrar->Register(new Traits\PrimaryKey($PrimaryKeyColumns));
     }
     $this->RegisterStructuralTraits($Registrar);
     foreach ($Registrar->GetRegistered() as $Trait) {
         $this->AddTrait($Trait);
     }
     $this->KeyGenerator = $this->KeyGenerator($Database->GetPlatform()->GetKeyGeneratorSet());
     if ($this->KeyGenerator !== null) {
         $this->KeyGenerator->SetTable($this);
     }
 }
Beispiel #3
0
 protected final function OnInitializeStructure(CoreDatabase $Context)
 {
     $this->CreateTableStructure($Context->GetPlatform()->GetColumnSet());
     parent::OnInitializeStructure($Context);
 }