コード例 #1
0
ファイル: Table.php プロジェクト: michaelnavarro/zc
 /**
  * @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];
 }
コード例 #2
0
ファイル: Table.php プロジェクト: TuxCoffeeCorner/tcc
 /**
  * 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]);
 }