public function renameForeignKey($oldName, $newName)
    {
        if (!$this->hasForeignKey($oldName)) {
            throw SchemaException::tableForeignKeyDoesNotExist($this->getName(), $oldName);
        }

        if ($this->hasForeignKey($newName)) {
            throw SchemaException::tableForeignKeyAlreadyExists($this->getName(), $newName);
        }

        $this->foreignKeys[$oldName]->setName($newName);
        $this->foreignKeys[$newName] = $this->foreignKeys[$oldName];
        unset($this->foreignKeys[$oldName]);
    }
public function renameForeignKey($oldName, $newName)
    {
        if (!$this->hasForeignKey($oldName)) {
            throw SchemaException::tableForeignKeyDoesNotExist($this->getName(), $oldName);
        }

        if ($this->hasForeignKey($newName)) {
            throw SchemaException::tableForeignKeyAlreadyExists($this->getName(), $newName);
        }

        $this->foreignKeys[$oldName]->setName($newName);
        $this->foreignKeys[$newName] = $this->foreignKeys[$oldName];
        unset($this->foreignKeys[$oldName]);
    }
public function renameForeignKey ( $ oldName , $ newName ) { if ( ! $ this -> hasForeignKey ( $ oldName ) ) { throw SchemaException :: tableForeignKeyDoesNotExist ( $ this -> getName ( ) , $ oldName ) ; } if ( $ this -> hasForeignKey ( $ newName ) ) { throw SchemaException :: tableForeignKeyAlreadyExists ( $ this -> getName ( ) , $ newName ) ; } $ this -> foreignKeys [ $ oldName ] -> setName ( $ newName ) ; $ this -> foreignKeys [ $ newName ] = $ this -> foreignKeys [ $ oldName ] ; unset ( $ this -> foreignKeys [ $ oldName ] ) ; }
Renames a foreign key.

@param string $oldName The old foreign key name.
@param string $newName The new foreign key name.

@throws \Fridge\DBAL\Exception\SchemaException If the old foreign key does not exist or if the new foreign key
already exists.
Renames a foreign key .