function FormElementBase::setConfig

Same name and namespace in other branches
  1. 11.x core/modules/config_translation/src/FormElement/FormElementBase.php \Drupal\config_translation\FormElement\FormElementBase::setConfig()
  2. 10 core/modules/config_translation/src/FormElement/FormElementBase.php \Drupal\config_translation\FormElement\FormElementBase::setConfig()
  3. 8.9.x core/modules/config_translation/src/FormElement/FormElementBase.php \Drupal\config_translation\FormElement\FormElementBase::setConfig()

File

core/modules/config_translation/src/FormElement/FormElementBase.php, line 174

Class

FormElementBase
Provides a common base class for form elements.

Namespace

Drupal\config_translation\FormElement

Code

public function setConfig(Config $base_config, LanguageConfigOverride $config_translation, $config_values, $base_key = NULL) {
  // Save the configuration values, if they are different from the source
  // values in the base configuration. Otherwise remove the override.
  if ($base_config->get($base_key) !== $config_values) {
    $config_translation->set($base_key, $config_values);
  }
  else {
    $config_translation->clear($base_key);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.