Register() public method

public Register ( $Instance )
示例#1
0
 public final function LoadRegistrarFromProperties(Registrar $Registrar)
 {
     $RegisterableType = $Registrar->GetRegisterableType();
     foreach ($this->GetPublicPropertyValues() as $Value) {
         if ($Value instanceof $RegisterableType) {
             $Registrar->Register($Value);
         }
     }
 }
示例#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);
     }
 }
示例#3
0
 protected function RegisterStructuralTraits(Registrar $Registrar)
 {
     $Registrar->Register(new Mysql\Tables\Engine('MYISAM'));
 }
示例#4
0
 protected function RegisterRelationalTraits(Registrar $Registrar, Relational\Database $Context)
 {
     $Registrar->Register($this->ForeignKey1);
     $Registrar->Register($this->ForeignKey2);
 }