Esempio n. 1
0
 /**
  * @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];
 }
Esempio n. 2
0
 /**
  * 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]);
 }