|
@@ 589-597 (lines=9) @@
|
| 586 |
|
* |
| 587 |
|
* @throws SchemaException If the foreign key does not exist. |
| 588 |
|
*/ |
| 589 |
|
public function getForeignKey($constraintName) |
| 590 |
|
{ |
| 591 |
|
$constraintName = $this->normalizeIdentifier($constraintName); |
| 592 |
|
if (!$this->hasForeignKey($constraintName)) { |
| 593 |
|
throw SchemaException::foreignKeyDoesNotExist($constraintName, $this->_name); |
| 594 |
|
} |
| 595 |
|
|
| 596 |
|
return $this->_fkConstraints[$constraintName]; |
| 597 |
|
} |
| 598 |
|
|
| 599 |
|
/** |
| 600 |
|
* Removes the foreign key constraint with the given name. |
|
@@ 608-616 (lines=9) @@
|
| 605 |
|
* |
| 606 |
|
* @throws SchemaException |
| 607 |
|
*/ |
| 608 |
|
public function removeForeignKey($constraintName) |
| 609 |
|
{ |
| 610 |
|
$constraintName = $this->normalizeIdentifier($constraintName); |
| 611 |
|
if (!$this->hasForeignKey($constraintName)) { |
| 612 |
|
throw SchemaException::foreignKeyDoesNotExist($constraintName, $this->_name); |
| 613 |
|
} |
| 614 |
|
|
| 615 |
|
unset($this->_fkConstraints[$constraintName]); |
| 616 |
|
} |
| 617 |
|
|
| 618 |
|
/** |
| 619 |
|
* Returns ordered list of columns (primary keys are first, then foreign keys, then the rest) |