src/Phinx/Db/Adapter/SqlServerAdapter.php
protected function getForeignKeySqlDefinition(ForeignKey $foreignKey, $tableName)
    {
        $constraintName = $foreignKey->getConstraint() ?: $tableName . '_' . implode('_', $foreignKey->getColumns());
        $def = ' CONSTRAINT ' . $this->quoteColumnName($constraintName);
        $def .= ' FOREIGN KEY ("' . implode('", "', $foreignKey->getColumns()) . '")';
        $def .= " REFERENCES {$this->quoteTableName($foreignKey->getReferencedTable()->getName())} (\"" . implode('", "', $foreignKey->getReferencedColumns()) . '")';
        if ($foreignKey->getOnDelete()) {
            $def .= " ON DELETE {$foreignKey->getOnDelete()}";
        }
        if ($foreignKey->getOnUpdate()) {
            $def .= " ON UPDATE {$foreignKey->getOnUpdate()}";
        }

        return $def;
    }
protected function getForeignKeySqlDefinition(ForeignKey $foreignKey, $tableName)
    {
        $constraintName = $foreignKey->getConstraint() ?: $tableName . '_' . implode('_', $foreignKey->getColumns());
        $def = ' CONSTRAINT ' . $this->quoteColumnName($constraintName);
        $def .= ' FOREIGN KEY ("' . implode('", "', $foreignKey->getColumns()) . '")';
        $def .= " REFERENCES {$this->quoteTableName($foreignKey->getReferencedTable()->getName())} (\"" . implode('", "', $foreignKey->getReferencedColumns()) . '")';
        if ($foreignKey->getOnDelete()) {
            $def .= " ON DELETE {$foreignKey->getOnDelete()}";
        }
        if ($foreignKey->getOnUpdate()) {
            $def .= " ON UPDATE {$foreignKey->getOnUpdate()}";
        }

        return $def;
    }
protected function getForeignKeySqlDefinition ( ForeignKey $ foreignKey , $ tableName ) { $ constraintName = $ foreignKey -> getConstraint ( ) ? : $ tableName . '_' . implode ( '_' , $ foreignKey -> getColumns ( ) ) ; $ def = ' CONSTRAINT ' . $ this -> quoteColumnName ( $ constraintName ) ; $ def .= ' FOREIGN KEY ("' . implode ( '", "' , $ foreignKey -> getColumns ( ) ) . '")' ; $ def .= " REFERENCES {$this->quoteTableName($foreignKey->getReferencedTable()->getName())} (\"" . implode ( '", "' , $ foreignKey -> getReferencedColumns ( ) ) . '")' ; if ( $ foreignKey -> getOnDelete ( ) ) { $ def .= " ON DELETE {$foreignKey->getOnDelete()}" ; } if ( $ foreignKey -> getOnUpdate ( ) ) { $ def .= " ON UPDATE {$foreignKey->getOnUpdate()}" ; } return $ def ; }
Gets the SqlServer Foreign Key Definition for an ForeignKey object.

@param \Phinx\Db\Table\ForeignKey $foreignKey
@return string
Gets the SqlServer Foreign Key Definition for an ForeignKey object .