/** * Filters data in the override based on what is currently in configuration. * * @param \Drupal\Core\Config\Config $config * Current configuration object. * @param \Drupal\Core\Config\StorableConfigBase $override * Override object corresponding to the configuration to filter data in. */ protected function filterOverride(Config $config, StorableConfigBase $override) { $override_data = $override->get(); $this->filterNestedArray($config->get(), $override_data); if (empty($override_data)) { // If no override values are left that would apply, remove the override. $override->delete(); } else { // Otherwise set the filtered override values back. $override->setData($override_data)->save(); } }
/** * {@inheritdoc} */ public function setData(array $data) { parent::setData($data); $this->resetOverriddenData(); return $this; }
/** * {@inheritdoc} */ public function setData(array $data, $validate_keys = TRUE) { parent::setData($data, $validate_keys); $this->resetOverriddenData(); return $this; }