protected function ConfigFactoryOverrideBase::filterOverride
protected ConfigFactoryOverrideBase::filterOverride(Config $config, StorableConfigBase $override)
Filters data in the override based on what is currently in configuration.
Parameters
\Drupal\Core\Config\Config $config: Current configuration object.
\Drupal\Core\Config\StorableConfigBase $override: Override object corresponding to the configuration to filter data in.
File
- core/lib/Drupal/Core/Config/ConfigFactoryOverrideBase.php, line 63
Class
- ConfigFactoryOverrideBase
- Defines a base event listener implementation configuration overrides.
Namespace
Drupal\Core\ConfigCode
protected function filterOverride(Config $config, StorableConfigBase $override) { $override_data = $override->get(); $changed = $this->filterNestedArray($config->get(), $override_data); if (empty($override_data)) { // If no override values are left that would apply, remove the override. $override->delete(); } elseif ($changed) { // Otherwise set the filtered override values back. $override->setData($override_data)->save(TRUE); } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!ConfigFactoryOverrideBase.php/function/ConfigFactoryOverrideBase::filterOverride/8.1.x