ConfigRenameEvent.php 801 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Drupal\Core\Config;
  3. /**
  4. * Configuration event fired when renaming a configuration object.
  5. */
  6. class ConfigRenameEvent extends ConfigCrudEvent {
  7. /**
  8. * The old configuration object name.
  9. *
  10. * @var string
  11. */
  12. protected $oldName;
  13. /**
  14. * Constructs the config rename event.
  15. *
  16. * @param \Drupal\Core\Config\Config $config
  17. * The configuration that has been renamed.
  18. * @param string $old_name
  19. * The old configuration object name.
  20. */
  21. public function __construct(Config $config, $old_name) {
  22. $this->config = $config;
  23. $this->oldName = $old_name;
  24. }
  25. /**
  26. * Gets the old configuration object name.
  27. *
  28. * @return string
  29. * The old configuration object name.
  30. */
  31. public function getOldName() {
  32. return $this->oldName;
  33. }
  34. }