class ConfigModuleOverridesEvent in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Config/ConfigModuleOverridesEvent.php \Drupal\Core\Config\ConfigModuleOverridesEvent
Event object to allow configuration to be overridden by modules.
Hierarchy
- class \Symfony\Component\EventDispatcher\Event
- class \Drupal\Core\Config\ConfigModuleOverridesEvent
Expanded class hierarchy of ConfigModuleOverridesEvent
File
- core/
lib/ Drupal/ Core/ Config/ ConfigModuleOverridesEvent.php, line 17 - Contains \Drupal\Core\Config\ConfigModuleOverridesEvent.
Namespace
Drupal\Core\ConfigView source
class ConfigModuleOverridesEvent extends Event {
/**
* Configuration names.
*
* @var array
*/
protected $names;
/**
* Configuration overrides.
*
* @var array
*/
protected $overrides;
/**
* The Language object used to override configuration data.
*
* @var \Drupal\Core\Language\LanguageInterface
*/
protected $language;
/**
* Constructs a configuration overrides event object.
*
* @param array $names
* A list of configuration names.
* @param \Drupal\Core\Language\LanguageInterface
* (optional) The language for this configuration.
*/
public function __construct(array $names, LanguageInterface $language = NULL) {
$this->names = $names;
$this->language = $language;
$this->overrides = array();
}
/**
* Gets configuration names.
*
* @return array
* The list of configuration names that can be overridden.
*/
public function getNames() {
return $this->names;
}
/**
* Gets configuration language.
*
* @return \Drupal\Core\Language\LanguageInterface
* The configuration language object.
*/
public function getLanguage() {
return $this->language;
}
/**
* Get configuration overrides.
*
* @return array.
* The array of configuration overrides.
*/
public function getOverrides() {
return $this->overrides;
}
/**
* Sets a configuration override for the given name.
*
* @param string $name
* The configuration object name to override.
* @param array $values
* The values in the configuration object to override.
*
* @return $this
*/
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(array(
$values,
$this->overrides[$name],
), TRUE);
}
else {
$this->overrides[$name] = $values;
}
}
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigModuleOverridesEvent:: |
protected | property | The Language object used to override configuration data. | |
ConfigModuleOverridesEvent:: |
protected | property | Configuration names. | |
ConfigModuleOverridesEvent:: |
protected | property | Configuration overrides. | |
ConfigModuleOverridesEvent:: |
public | function | Gets configuration language. | |
ConfigModuleOverridesEvent:: |
public | function | Gets configuration names. | |
ConfigModuleOverridesEvent:: |
public | function | Get configuration overrides. | |
ConfigModuleOverridesEvent:: |
public | function | Sets a configuration override for the given name. | |
ConfigModuleOverridesEvent:: |
public | function | Constructs a configuration overrides event object. | |
Event:: |
private | property | ||
Event:: |
private | property | ||
Event:: |
private | property | ||
Event:: |
public | function | Returns the EventDispatcher that dispatches this Event. | |
Event:: |
public | function | Gets the event's name. | |
Event:: |
public | function | Returns whether further event listeners should be triggered. | |
Event:: |
public | function | Stores the EventDispatcher that dispatches this Event. | |
Event:: |
public | function | Sets the event's name property. | |
Event:: |
public | function | Stops the propagation of the event to further event listeners. |