StorageTransformEvent.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace Drupal\Core\Config;
  3. use Symfony\Component\EventDispatcher\Event;
  4. /**
  5. * Class StorageTransformEvent.
  6. *
  7. * This event allows subscribers to alter the configuration of the storage that
  8. * is being transformed.
  9. */
  10. class StorageTransformEvent extends Event {
  11. /**
  12. * The configuration storage which is transformed.
  13. *
  14. * This storage can be interacted with by event subscribers and will be
  15. * used instead of the original storage after all event subscribers have been
  16. * called.
  17. *
  18. * @var \Drupal\Core\Config\StorageInterface
  19. */
  20. protected $storage;
  21. /**
  22. * StorageTransformEvent constructor.
  23. *
  24. * @param \Drupal\Core\Config\StorageInterface $storage
  25. * The storage with the configuration to transform.
  26. */
  27. public function __construct(StorageInterface $storage) {
  28. $this->storage = $storage;
  29. }
  30. /**
  31. * Returns the mutable storage ready to be read from and written to.
  32. *
  33. * @return \Drupal\Core\Config\StorageInterface
  34. * The config storage.
  35. */
  36. public function getStorage() {
  37. return $this->storage;
  38. }
  39. }