blizz_vanisher-8.x-1.x-dev/blizz_vanisher.install
blizz_vanisher.install
<?php
/**
* Updates the names of the settings variables.
*/
function blizz_vanisher_update_8001() {
/* @var \Drupal\Core\Config\ConfigFactoryInterface $config_fatory_service */
$config_fatory_service = \Drupal::service('config.factory');
/* @var \Drupal\Core\Config\Config $settings */
$settings = $config_fatory_service->getEditable(\Drupal\blizz_vanisher\Form\SettingsForm::SETTINGS_NAME);
foreach (
[
'hashtag',
'high_privacy',
'orientation',
'adblocker',
'show_alert_small',
'cookieslist',
'remove_credit',
'default_rejected',
] as $variable
) {
$value = $settings->get($variable);
$settings->set("blizz_vanisher_{$variable}", $value);
$settings->clear($variable);
}
$settings->save();
}
