| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| 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 | $reference = new self($table, $tablePrefix, $schema['CONSTRAINT_NAME']); |
||
| 23 | |||
| 24 | $reference->column = $schema['COLUMN_NAME']; |
||
| 25 | |||
| 26 | $reference->foreignTable = $schema['REFERENCED_TABLE_NAME']; |
||
| 27 | $reference->foreignKey = $schema['REFERENCED_COLUMN_NAME']; |
||
| 28 | |||
| 29 | $reference->deleteRule = $schema['DELETE_RULE']; |
||
| 30 | $reference->updateRule = $schema['UPDATE_RULE']; |
||
| 31 | |||
| 32 | return $reference; |
||
| 33 | } |
||
| 34 | } |