ConfigEvents.php 3.42 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
<?php

/**
 * @file
 * Contains Drupal\Core\Config\Config\ConfigEvents.
 */

namespace Drupal\Core\Config;

/**
 * Defines events for the configuration system.
12 13
 *
 * @see \Drupal\Core\Config\ConfigCrudEvent
14
 */
15
final class ConfigEvents {
16 17

  /**
18
   * Name of the event fired when saving a configuration object.
19
   *
20 21 22 23 24 25 26
   * This event allows modules to perform an action whenever a configuration
   * object is saved. The event listener method receives a
   * \Drupal\Core\Config\ConfigCrudEvent instance.
   *
   * @Event
   *
   * @see \Drupal\Core\Config\ConfigCrudEvent
27 28
   * @see \Drupal\Core\Config\Config::save()
   * @see \Drupal\Core\Config\ConfigFactory::onConfigSave()
29 30
   *
   * @var string
31 32 33 34
   */
  const SAVE = 'config.save';

  /**
35 36 37 38 39 40 41
   * Name of the event fired when deleting a configuration object.
   *
   * This event allows modules to perform an action whenever a configuration
   * object is deleted. The event listener method receives a
   * \Drupal\Core\Config\ConfigCrudEvent instance.
   *
   * @Event
42
   *
43
   * @see \Drupal\Core\Config\ConfigCrudEvent
44
   * @see \Drupal\Core\Config\Config::delete()
45 46 47
   * @see \Drupal\Core\Config\ConfigFactory::onConfigDelete()
   *
   * @var string
48 49 50 51
   */
  const DELETE = 'config.delete';

  /**
52 53 54 55 56 57 58
   * Name of the event fired when renaming a configuration object.
   *
   * This event allows modules to perform an action whenever a configuration
   * object's name is changed. The event listener method receives a
   * \Drupal\Core\Config\ConfigRenameEvent instance.
   *
   * @Event
59
   *
60
   * @see \Drupal\Core\Config\ConfigRenameEvent
61
   * @see \Drupal\Core\Config\ConfigFactoryInterface::rename().
62 63
   *
   * @var string
64 65 66 67
   */
  const RENAME = 'config.rename';

  /**
68 69 70 71 72
   * Name of the event fired when validating imported configuration.
   *
   * This event allows modules to perform additional validation operations when
   * configuration is being imported. The event listener method receives a
   * \Drupal\Core\Config\ConfigImporterEvent instance.
73
   *
74 75 76
   * @Event
   *
   * @see \Drupal\Core\Config\ConfigImporterEvent
77 78
   * @see \Drupal\Core\Config\ConfigImporter::validate().
   * @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber::onConfigImporterValidate().
79 80
   *
   * @var string
81
   */
82
  const IMPORT_VALIDATE = 'config.importer.validate';
83 84

  /**
85 86 87 88 89
   * Name of the event fired when importing configuration to target storage.
   *
   * This event allows modules to perform additional actions when configuration
   * is imported. The event listener method receives a
   * \Drupal\Core\Config\ConfigImporterEvent instance.
90
   *
91 92 93
   * @Event
   *
   * @see \Drupal\Core\Config\ConfigImporterEvent
94 95
   * @see \Drupal\Core\Config\ConfigImporter::import().
   * @see \Drupal\Core\EventSubscriber\ConfigSnapshotSubscriber::onConfigImporterImport().
96 97
   *
   * @var string
98 99 100
   */
  const IMPORT = 'config.importer.import';

101
  /**
102 103 104 105 106 107 108 109
   * Name of event fired to collect information on all config collections.
   *
   * This event allows modules to add to the list of configuration collections
   * retrieved by \Drupal\Core\Config\ConfigManager::getConfigCollectionInfo().
   * The event listener method receives a
   * \Drupal\Core\Config\ConfigCollectionInfo instance.
   *
   * @Event
110
   *
111
   * @see \Drupal\Core\Config\ConfigCollectionInfo
112 113 114 115
   * @see \Drupal\Core\Config\ConfigManager::getConfigCollectionInfo()
   * @see \Drupal\Core\Config\ConfigFactoryOverrideBase
   *
   * @var string
116
   */
117
  const COLLECTION_INFO = 'config.collection_info';
118

119
}