Storm\Drivers\Base\Relational\Traits\ForeignKey::GetParentReferencedColumnNameMap PHP Method

GetParentReferencedColumnNameMap() final public method

    public final function GetParentReferencedColumnNameMap()
    {
        return $this->ParentReferencedColumnNameMap;
    }

Usage Example

Ejemplo n.º 1
0
 public function ForeignKey(QueryBuilder $QueryBuilder, Table $Table, Traits\ForeignKey $Trait)
 {
     $ColumnNameMap = $Trait->GetParentReferencedColumnNameMap();
     $PrimaryColumns = array_keys($ColumnNameMap);
     $ForeignColumns = array_values($ColumnNameMap);
     $QueryBuilder->AppendIdentifier('CONSTRAINT # ', [$Trait->GetName()]);
     $QueryBuilder->AppendIdentifiers('FOREIGN KEY (#) ', $PrimaryColumns, ',');
     $QueryBuilder->AppendIdentifier('REFERENCES # ', [$Trait->GetReferencedTable()->GetName()]);
     $QueryBuilder->AppendIdentifiers('(#) ', $ForeignColumns, ',');
     $QueryBuilder->Append('ON UPDATE ' . $this->MapForeignKeyMode($Trait->GetUpdateMode()) . ' ');
     $QueryBuilder->Append('ON DELETE ' . $this->MapForeignKeyMode($Trait->GetDeleteMode()) . ' ');
 }