You are here

class ConfigCrudEvent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Config/ConfigCrudEvent.php \Drupal\Core\Config\ConfigCrudEvent

Wraps a configuration event for event listeners.

Hierarchy

Expanded class hierarchy of ConfigCrudEvent

9 files declare their use of ConfigCrudEvent
ConfigCacheTag.php in core/modules/system/src/EventSubscriber/ConfigCacheTag.php
Contains \Drupal\system\EventSubscriber\ConfigCacheTag.
ConfigSchemaChecker.php in core/lib/Drupal/Core/Config/Testing/ConfigSchemaChecker.php
Contains \Drupal\Core\Config\Testing\ConfigSchemaChecker.
ConfigSubscriber.php in core/modules/language/src/EventSubscriber/ConfigSubscriber.php
Contains \Drupal\language\EventSubscriber\ConfigSubscriber.
EventSubscriber.php in core/modules/config/tests/config_import_test/src/EventSubscriber.php
Contains \Drupal\config_import_test\EventSubscriber.
EventSubscriber.php in core/modules/config/tests/config_events_test/src/EventSubscriber.php
Contains \Drupal\config_events_test\EventSubscriber.

... See full list

File

core/lib/Drupal/Core/Config/ConfigCrudEvent.php, line 15
Contains \Drupal\Core\Config\ConfigCrudEvent.

Namespace

Drupal\Core\Config
View source
class ConfigCrudEvent extends Event {

  /**
   * Configuration object.
   *
   * @var \Drupal\Core\Config\Config
   */
  protected $config;

  /**
   * Constructs a configuration event object.
   *
   * @param \Drupal\Core\Config\Config
   *   Configuration object.
   */
  public function __construct(Config $config) {
    $this->config = $config;
  }

  /**
   * Gets configuration object.
   *
   * @return \Drupal\Core\Config\Config
   *   The configuration object that caused the event to fire.
   */
  public function getConfig() {
    return $this->config;
  }

  /**
   * Checks to see if the provided configuration key's value has changed.
   *
   * @param string $key
   *   The configuration key to check if it has changed.
   *
   * @return bool
   */
  public function isChanged($key) {
    return $this->config
      ->get($key) !== $this->config
      ->getOriginal($key);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigCrudEvent::$config protected property Configuration object.
ConfigCrudEvent::getConfig public function Gets configuration object.
ConfigCrudEvent::isChanged public function Checks to see if the provided configuration key's value has changed.
ConfigCrudEvent::__construct public function Constructs a configuration event object. 1
Event::$dispatcher private property
Event::$name private property
Event::$propagationStopped private property
Event::getDispatcher Deprecated public function Returns the EventDispatcher that dispatches this Event.
Event::getName Deprecated public function Gets the event's name.
Event::isPropagationStopped public function Returns whether further event listeners should be triggered.
Event::setDispatcher Deprecated public function Stores the EventDispatcher that dispatches this Event.
Event::setName Deprecated public function Sets the event's name property.
Event::stopPropagation public function Stops the propagation of the event to further event listeners.