Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public static function createInstance(string $table, string $tablePrefix, array $schema): self |
||
21 | { |
||
22 | $foreign = new self($table, $tablePrefix, $schema['FK_NAME']); |
||
23 | |||
24 | $foreign->column = $schema['FKCOLUMN_NAME']; |
||
25 | $foreign->foreignTable = $schema['PKTABLE_NAME']; |
||
26 | $foreign->foreignKey = $schema['PKCOLUMN_NAME']; |
||
27 | |||
28 | $foreign->deleteRule = $schema['DELETE_RULE'] ? self::NO_ACTION : self::CASCADE; |
||
29 | $foreign->updateRule = $schema['UPDATE_RULE'] ? self::NO_ACTION : self::CASCADE; |
||
30 | |||
31 | return $foreign; |
||
32 | } |
||
33 | } |