You are here

class ConfigRevertEvent in Configuration Update Manager 8

Event context class for configuration revert/import events.

This class is passed in as the event when the \Drupal\config_update\ConfigRevertInterface::IMPORT, \Drupal\config_update\ConfigDeleteInterface::DELETE, and \Drupal\config_update\ConfigRevertInterface::REVERT events are triggered.

Hierarchy

  • class \Drupal\config_update\ConfigRevertEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of ConfigRevertEvent

File

src/ConfigRevertEvent.php, line 15

Namespace

Drupal\config_update
View source
class ConfigRevertEvent extends Event {

  /**
   * The type of configuration that is being imported or reverted.
   *
   * @var string
   */
  protected $type;

  /**
   * The name of the config item being imported or reverted, without prefix.
   *
   * @var string
   */
  protected $name;

  /**
   * Constructs a new ConfigRevertEvent.
   *
   * @param string $type
   *   The type of configuration being imported or reverted.
   * @param string $name
   *   The name of the config item being imported/reverted, without prefix.
   */
  public function __construct($type, $name) {
    $this->type = $type;
    $this->name = $name;
  }

  /**
   * Returns the type of configuration being imported or reverted.
   *
   * @return string
   *   The type of configuration, either 'system.simple' or a config entity
   *   type machine name.
   */
  public function getType() {
    return $this->type;
  }

  /**
   * Returns the name of the config item, without prefix.
   *
   * @return string
   *   The name of the config item being imported/reverted/deleted, with the
   *   prefix.
   */
  public function getName() {
    return $this->name;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigRevertEvent::$name protected property The name of the config item being imported or reverted, without prefix.
ConfigRevertEvent::$type protected property The type of configuration that is being imported or reverted.
ConfigRevertEvent::getName public function Returns the name of the config item, without prefix.
ConfigRevertEvent::getType public function Returns the type of configuration being imported or reverted.
ConfigRevertEvent::__construct public function Constructs a new ConfigRevertEvent.