Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ConfigModuleOverridesEvent.php

function ConfigModuleOverridesEvent::setOverride

Sets a configuration override for the given name.

Parameters

string $name: The configuration object name to override.

array $values: The values in the configuration object to override.

Return value

$this

File

core/lib/Drupal/Core/Config/ConfigModuleOverridesEvent.php, line 89

Class

ConfigModuleOverridesEvent
Event object to allow configuration to be overridden by modules.

Namespace

Drupal\Core\Config

Code

public function setOverride($name, array $values) {
    if (in_array($name, $this->names)) {
        if (isset($this->overrides[$name])) {
            // Existing overrides take precedence since these will have been added
            // by events with a higher priority.
            $this->overrides[$name] = NestedArray::mergeDeepArray([
                $values,
                $this->overrides[$name],
            ], TRUE);
        }
        else {
            $this->overrides[$name] = $values;
        }
    }
    return $this;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal