Inheritance: extends TableTrait
示例#1
0
 protected function IsStructuralTrait(StructuralTableTrait $OtherTrait)
 {
     if (count($this->Columns) !== count($OtherTrait->Columns)) {
         return false;
     }
     foreach ($this->Columns as $Key => $Column) {
         if ($Column->GetName() !== $OtherTrait->Columns[$Key]->GetName()) {
             return false;
         }
         if ($this->GetColumnDirection($Column) !== $OtherTrait->GetColumnDirection($OtherTrait->Columns[$Key])) {
             return false;
         }
     }
     return true;
 }
示例#2
0
 public final function AddTrait(TableTrait $Trait)
 {
     if ($Trait instanceof StructuralTableTrait) {
         $this->StructuralTraits[] = $Trait;
         $this->Traits[] = $Trait;
     } else {
         if ($Trait instanceof RelationalTableTrait) {
             $this->RelationalTraits[] = $Trait;
             $this->Traits[] = $Trait;
         } else {
             throw new \Storm\Core\UnexpectedValueException('The supplied trait must derive from either %s or %s: %s given', StructuralTableTrait::GetType(), RelationalTableTrait::GetType(), $Trait->GetType());
         }
     }
 }