function ListElement::setConfig

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

Overrides ElementInterface::setConfig

File

core/modules/config_translation/src/FormElement/ListElement.php, line 83

Class

ListElement
Defines the list element for the configuration translation interface.

Namespace

Drupal\config_translation\FormElement

Code

public function setConfig(Config $base_config, LanguageConfigOverride $config_translation, $config_values, $base_key = NULL) {
    foreach ($this->element as $key => $element) {
        $element_key = isset($base_key) ? "{$base_key}.{$key}" : $key;
        if ($form_element = ConfigTranslationFormBase::createFormElement($element)) {
            // Traverse into the next level of the configuration.
            $value = isset($config_values[$key]) ? $config_values[$key] : NULL;
            $form_element->setConfig($base_config, $config_translation, $value, $element_key);
        }
    }
}

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