Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 75% |
Changes | 0 |
1 | <?php |
||
9 | final class TableSchema extends AbstractTableSchema |
||
10 | { |
||
11 | /** |
||
12 | * @psalm-var array<array-key, array> |
||
13 | */ |
||
14 | private array $foreignKeys = []; |
||
15 | |||
16 | /** |
||
17 | * ```php |
||
18 | * [ |
||
19 | * 'ForeignTableName', |
||
20 | * 'fk1' => 'pk1', // pk1 is in foreign table |
||
21 | * 'fk2' => 'pk2', // if composite foreign key |
||
22 | * ] |
||
23 | * ``` |
||
24 | * |
||
25 | * @return array foreign keys of this table. Each array element is of the following structure: |
||
26 | */ |
||
27 | 5 | public function getForeignKeys(): array |
|
28 | { |
||
29 | 5 | return $this->foreignKeys; |
|
30 | } |
||
31 | |||
32 | 5 | public function compositeFK(int $id, string $from, string $to): void |
|
35 | } |
||
36 | |||
37 | 5 | public function foreignKey(int $id, array $to): void |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * @psalm-param array<array-key, array> $value |
||
44 | */ |
||
45 | public function foreignKeys(array $value): void |
||
48 | } |
||
49 | } |
||
50 |