| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function getSetPresetValues(string $table, string $columnName): ?string |
||
| 32 | { |
||
| 33 | /** @var MigrationGeneratorSetting $setting */ |
||
| 34 | $setting = app(MigrationGeneratorSetting::class); |
||
| 35 | |||
| 36 | $column = DB::connection($setting->getConnection())->select("SHOW COLUMNS FROM `${table}` where Field = '${columnName}' AND Type LIKE 'set(%'"); |
||
| 37 | if (count($column) > 0) { |
||
| 38 | return substr( |
||
| 39 | str_replace('set(', '[', $column[0]->Type), |
||
| 40 | 0, |
||
| 41 | -1 |
||
| 42 | ).']'; |
||
| 43 | } |
||
| 44 | |||
| 45 | return null; |
||
| 46 | } |
||
| 47 | } |
||
| 48 |