| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 56 | public static function createInstance(string $table, string $tablePrefix, array $schema): self |
|
| 26 | { |
||
| 27 | 56 | $reference = new self($table, $tablePrefix, $schema['CONSTRAINT_NAME']); |
|
| 28 | |||
| 29 | 56 | $reference->columns = $schema['COLUMN_NAME']; |
|
| 30 | 56 | $reference->foreignTable = $schema['REFERENCED_TABLE_NAME']; |
|
| 31 | 56 | $reference->foreignKeys = $schema['REFERENCED_COLUMN_NAME']; |
|
| 32 | |||
| 33 | 56 | $reference->deleteRule = $schema['DELETE_RULE']; |
|
| 34 | 56 | $reference->updateRule = $schema['UPDATE_RULE']; |
|
| 35 | |||
| 36 | 56 | return $reference; |
|
| 37 | } |
||
| 44 |