function Config::setOverriddenData

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/Config.php \Drupal\Core\Config\Config::setOverriddenData()
  2. 10 core/lib/Drupal/Core/Config/Config.php \Drupal\Core\Config\Config::setOverriddenData()
  3. 11.x core/lib/Drupal/Core/Config/Config.php \Drupal\Core\Config\Config::setOverriddenData()

Sets the current data for this configuration object.

Configuration overrides operate at two distinct layers: modules and settings.php. Overrides in settings.php take precedence over values provided by modules. Precedence or different module overrides is determined by the priority of the config.factory.override tagged services.

Return value

$this The configuration object.

1 call to Config::setOverriddenData()
Config::get in core/lib/Drupal/Core/Config/Config.php
Gets data from this configuration object.

File

core/lib/Drupal/Core/Config/Config.php, line 155

Class

Config
Defines the default configuration object.

Namespace

Drupal\Core\Config

Code

protected function setOverriddenData() {
    $this->overriddenData = $this->data;
    if (isset($this->moduleOverrides) && is_array($this->moduleOverrides)) {
        $this->overriddenData = NestedArray::mergeDeepArray([
            $this->overriddenData,
            $this->moduleOverrides,
        ], TRUE);
    }
    if (isset($this->settingsOverrides) && is_array($this->settingsOverrides)) {
        $this->overriddenData = NestedArray::mergeDeepArray([
            $this->overriddenData,
            $this->settingsOverrides,
        ], TRUE);
    }
    return $this;
}

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