public function ConfigSelector::setCurrentConfigList in Configuration selector 8.2
Same name and namespace in other branches
- 8 src/ConfigSelector.php \Drupal\config_selector\ConfigSelector::setCurrentConfigList()
Stores a list of active configuration prior to module installation.
The list makes it simple to work out what configuration is new and if we have to enable or disable any configuration.
Parameters
string $module: The module being installed.
Return value
$this
See also
config_selector_module_preinstall()
File
- src/
ConfigSelector.php, line 130
Class
- ConfigSelector
- Selects configuration to enable after a module install or uninstall.
Namespace
Drupal\config_selectorCode
public function setCurrentConfigList($module) {
// This should only trigger once per set of modules passed to the
// ModuleInstaller to install. As service will be rebuild during the module
// install a private static variable is used to store this information.
if (static::$modulePreinstallTriggered !== NULL) {
return $this;
}
static::$modulePreinstallTriggered = $module;
if ($module === 'config_selector') {
// If the Configuration Selector module is being installed, process all
// existing configuration in
// \Drupal\config_selector\ConfigSelector::selectConfig().
$list = [];
}
else {
$list = $this->configFactory
->listAll();
}
$this->state
->set('config_selector.current_config_list', $list);
return $this;
}