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

Breadcrumb

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

class ConfigCrudEvent

Wraps a configuration event for event listeners.

Hierarchy

  • class \Symfony\Contracts\EventDispatcher\Event implements \Psr\EventDispatcher\StoppableEventInterface
    • class \Drupal\Component\EventDispatcher\Event extends \Symfony\Contracts\EventDispatcher\Event
      • class \Drupal\Core\Config\ConfigCrudEvent extends \Drupal\Component\EventDispatcher\Event

Expanded class hierarchy of ConfigCrudEvent

17 files declare their use of ConfigCrudEvent
AdvisoriesConfigSubscriber.php in core/modules/system/src/EventSubscriber/AdvisoriesConfigSubscriber.php
CheckpointStorage.php in core/lib/Drupal/Core/Config/Checkpoint/CheckpointStorage.php
CKEditor5CacheTag.php in core/modules/ckeditor5/src/EventSubscriber/CKEditor5CacheTag.php
ConfigCacheTag.php in core/modules/system/src/EventSubscriber/ConfigCacheTag.php
ConfigSchemaChecker.php in core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php

... See full list

File

core/lib/Drupal/Core/Config/ConfigCrudEvent.php, line 10

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\StorableConfigBase $config
     *   Configuration object.
     */
    public function __construct(StorableConfigBase $config) {
        $this->config = $config;
    }
    
    /**
     * Gets configuration object.
     *
     * @return \Drupal\Core\Config\StorableConfigBase
     *   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

Title Sort descending Modifiers Object type Summary 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

API Navigation

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