public function Config::merge

Merges data into a configuration object.

Parameters

array $data_to_merge: An array containing data to merge.

Return value

\Drupal\Core\Config\Config The configuration object.

File

drupal/core/lib/Drupal/Core/Config/Config.php, line 484
Definition of Drupal\Core\Config\Config.

Class

Config
Defines the default configuration object.

Namespace

Drupal\Core\Config

Code

public function merge(array $data_to_merge) {
  if (!$this->isLoaded) {
    $this
      ->load();
  }

  // Preserve integer keys so that config keys are not changed.
  $this
    ->replaceData(NestedArray::mergeDeepArray(array(
    $this->data,
    $data_to_merge,
  ), TRUE));
  return $this;
}