function FormElementBase::setConfig

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

Overrides ElementInterface::setConfig

1 call to FormElementBase::setConfig()
PluralVariants::setConfig in core/modules/config_translation/src/FormElement/PluralVariants.php
Sets configuration based on a nested form value array.
1 method overrides FormElementBase::setConfig()
PluralVariants::setConfig in core/modules/config_translation/src/FormElement/PluralVariants.php
Sets configuration based on a nested form value array.

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.