/** * @param string $constraintName * @return ForeignKeyConstraint */ public function getForeignKey($constraintName) { $constraintName = strtolower($constraintName); if (!$this->hasForeignKey($constraintName)) { throw SchemaException::foreignKeyDoesNotExist($constraintName, $this->_name); } return $this->_fkConstraints[$constraintName]; }
/** * Removes the foreign key constraint with the given name. * * @param string $constraintName The constraint name. * * @return void * * @throws \Doctrine\DBAL\Schema\SchemaException */ public function removeForeignKey($constraintName) { $constraintName = strtolower($constraintName); if (!$this->hasForeignKey($constraintName)) { throw SchemaException::foreignKeyDoesNotExist($constraintName, $this->_name); } unset($this->_fkConstraints[$constraintName]); }