| Conditions | 7 |
| Paths | 9 |
| Total Lines | 25 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function up(Schema $schema): void |
||
| 20 | { |
||
| 21 | $defaultValues = 'name,officialcode,email,picture,login,password,language,phone,theme'; |
||
| 22 | |||
| 23 | $allChangeableOptions = $this |
||
| 24 | ->connection |
||
| 25 | ->executeQuery("SELECT id, selected_value FROM settings WHERE variable = 'changeable_options'") |
||
| 26 | ->fetchAllAssociative() |
||
| 27 | ; |
||
| 28 | |||
| 29 | foreach ($allChangeableOptions as $changeableOptions) { |
||
| 30 | if ($changeableOptions && empty($changeableOptions['selected_value'])) { |
||
| 31 | $this->addSql("UPDATE settings SET selected_value = '$defaultValues' WHERE id = {$changeableOptions['id']}"); |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | $allVisibleOptions = $this |
||
| 36 | ->connection |
||
| 37 | ->executeQuery("SELECT id, selected_value FROM settings WHERE variable = 'visible_options'") |
||
| 38 | ->fetchAllAssociative() |
||
| 39 | ; |
||
| 40 | |||
| 41 | foreach ($allVisibleOptions as $visibleOptions) { |
||
| 42 | if ($visibleOptions && empty($visibleOptions['selected_value'])) { |
||
| 43 | $this->addSql("UPDATE settings SET selected_value = '$defaultValues' WHERE id = {$visibleOptions['id']}"); |
||
| 44 | } |
||
| 48 |