| Total Complexity | 5 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | final class TableSchema extends AbstractTableSchema |
||
| 15 | { |
||
| 16 | private ?string $comment = null; |
||
| 17 | private array $foreignKeys = []; |
||
| 18 | |||
| 19 | 2 | public function getComment(): ?string |
|
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @return array foreign keys of this table. Each array element is of the following structure: |
||
| 26 | * |
||
| 27 | * ```php |
||
| 28 | * [ |
||
| 29 | * 'ForeignTableName', |
||
| 30 | * 'fk1' => 'pk1', // pk1 is in foreign table |
||
| 31 | * 'fk2' => 'pk2', // if composite foreign key |
||
| 32 | * ] |
||
| 33 | * ``` |
||
| 34 | */ |
||
| 35 | 1 | public function getForeignKeys(): array |
|
| 36 | { |
||
| 37 | 1 | return $this->foreignKeys; |
|
| 38 | } |
||
| 39 | |||
| 40 | 132 | public function comment(?string $comment): void |
|
| 41 | { |
||
| 42 | 132 | $this->comment = $comment; |
|
| 43 | 132 | } |
|
| 44 | |||
| 45 | 24 | public function foreignKey(string $id, array $to): void |
|
| 46 | { |
||
| 47 | 24 | $this->foreignKeys[$id] = $to; |
|
| 48 | 24 | } |
|
| 49 | |||
| 50 | 90 | public function foreignKeys(array $value): void |
|
| 53 | 90 | } |
|
| 54 | } |
||
| 55 |