Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\Core\Config;
|
Chris@0
|
4
|
Chris@0
|
5 /**
|
Chris@0
|
6 * Defines events for the configuration system.
|
Chris@0
|
7 *
|
Chris@0
|
8 * @see \Drupal\Core\Config\ConfigCrudEvent
|
Chris@0
|
9 */
|
Chris@0
|
10 final class ConfigEvents {
|
Chris@0
|
11
|
Chris@0
|
12 /**
|
Chris@0
|
13 * Name of the event fired when saving a configuration object.
|
Chris@0
|
14 *
|
Chris@0
|
15 * This event allows modules to perform an action whenever a configuration
|
Chris@0
|
16 * object is saved. The event listener method receives a
|
Chris@0
|
17 * \Drupal\Core\Config\ConfigCrudEvent instance.
|
Chris@0
|
18 *
|
Chris@0
|
19 * See hook_update_N() documentation for safe configuration API usage and
|
Chris@0
|
20 * restrictions as this event will be fired when configuration is saved by
|
Chris@0
|
21 * hook_update_N().
|
Chris@0
|
22 *
|
Chris@0
|
23 * @Event
|
Chris@0
|
24 *
|
Chris@0
|
25 * @see \Drupal\Core\Config\ConfigCrudEvent
|
Chris@0
|
26 * @see \Drupal\Core\Config\Config::save()
|
Chris@0
|
27 * @see \Drupal\Core\Config\ConfigFactory::onConfigSave()
|
Chris@0
|
28 * @see hook_update_N()
|
Chris@0
|
29 *
|
Chris@0
|
30 * @var string
|
Chris@0
|
31 */
|
Chris@0
|
32 const SAVE = 'config.save';
|
Chris@0
|
33
|
Chris@0
|
34 /**
|
Chris@0
|
35 * Name of the event fired when deleting a configuration object.
|
Chris@0
|
36 *
|
Chris@0
|
37 * This event allows modules to perform an action whenever a configuration
|
Chris@0
|
38 * object is deleted. The event listener method receives a
|
Chris@0
|
39 * \Drupal\Core\Config\ConfigCrudEvent instance.
|
Chris@0
|
40 *
|
Chris@0
|
41 * See hook_update_N() documentation for safe configuration API usage and
|
Chris@0
|
42 * restrictions as this event will be fired when configuration is deleted by
|
Chris@0
|
43 * hook_update_N().
|
Chris@0
|
44 *
|
Chris@0
|
45 * @Event
|
Chris@0
|
46 *
|
Chris@0
|
47 * @see \Drupal\Core\Config\ConfigCrudEvent
|
Chris@0
|
48 * @see \Drupal\Core\Config\Config::delete()
|
Chris@0
|
49 * @see \Drupal\Core\Config\ConfigFactory::onConfigDelete()
|
Chris@0
|
50 * @see hook_update_N()
|
Chris@0
|
51 *
|
Chris@0
|
52 * @var string
|
Chris@0
|
53 */
|
Chris@0
|
54 const DELETE = 'config.delete';
|
Chris@0
|
55
|
Chris@0
|
56 /**
|
Chris@0
|
57 * Name of the event fired when renaming a configuration object.
|
Chris@0
|
58 *
|
Chris@0
|
59 * This event allows modules to perform an action whenever a configuration
|
Chris@0
|
60 * object's name is changed. The event listener method receives a
|
Chris@0
|
61 * \Drupal\Core\Config\ConfigRenameEvent instance.
|
Chris@0
|
62 *
|
Chris@0
|
63 * See hook_update_N() documentation for safe configuration API usage and
|
Chris@0
|
64 * restrictions as this event will be fired when configuration is renamed by
|
Chris@0
|
65 * hook_update_N().
|
Chris@0
|
66 *
|
Chris@0
|
67 * @Event
|
Chris@0
|
68 *
|
Chris@0
|
69 * @see \Drupal\Core\Config\ConfigRenameEvent
|
Chris@0
|
70 * @see \Drupal\Core\Config\ConfigFactoryInterface::rename()
|
Chris@0
|
71 * @see hook_update_N()
|
Chris@0
|
72 *
|
Chris@0
|
73 * @var string
|
Chris@0
|
74 */
|
Chris@0
|
75 const RENAME = 'config.rename';
|
Chris@0
|
76
|
Chris@0
|
77 /**
|
Chris@0
|
78 * Name of the event fired when validating imported configuration.
|
Chris@0
|
79 *
|
Chris@0
|
80 * This event allows modules to perform additional validation operations when
|
Chris@0
|
81 * configuration is being imported. The event listener method receives a
|
Chris@0
|
82 * \Drupal\Core\Config\ConfigImporterEvent instance.
|
Chris@0
|
83 *
|
Chris@0
|
84 * @Event
|
Chris@0
|
85 *
|
Chris@0
|
86 * @see \Drupal\Core\Config\ConfigImporterEvent
|
Chris@0
|
87 * @see \Drupal\Core\Config\ConfigImporter::validate().
|
Chris@0
|
88 * @see \Drupal\Core\EventSubscriber\ConfigImportSubscriber::onConfigImporterValidate().
|
Chris@0
|
89 *
|
Chris@0
|
90 * @var string
|
Chris@0
|
91 */
|
Chris@0
|
92 const IMPORT_VALIDATE = 'config.importer.validate';
|
Chris@0
|
93
|
Chris@0
|
94 /**
|
Chris@0
|
95 * Name of the event fired when importing configuration to target storage.
|
Chris@0
|
96 *
|
Chris@0
|
97 * This event allows modules to perform additional actions when configuration
|
Chris@0
|
98 * is imported. The event listener method receives a
|
Chris@0
|
99 * \Drupal\Core\Config\ConfigImporterEvent instance.
|
Chris@0
|
100 *
|
Chris@0
|
101 * @Event
|
Chris@0
|
102 *
|
Chris@0
|
103 * @see \Drupal\Core\Config\ConfigImporterEvent
|
Chris@0
|
104 * @see \Drupal\Core\Config\ConfigImporter::import().
|
Chris@0
|
105 * @see \Drupal\Core\EventSubscriber\ConfigSnapshotSubscriber::onConfigImporterImport().
|
Chris@0
|
106 *
|
Chris@0
|
107 * @var string
|
Chris@0
|
108 */
|
Chris@0
|
109 const IMPORT = 'config.importer.import';
|
Chris@0
|
110
|
Chris@0
|
111 /**
|
Chris@0
|
112 * Name of event fired when missing content dependencies are detected.
|
Chris@0
|
113 *
|
Chris@0
|
114 * Events subscribers are fired as part of the configuration import batch.
|
Chris@0
|
115 * Each subscribe should call
|
Chris@0
|
116 * \Drupal\Core\Config\MissingContentEvent::resolveMissingContent() when they
|
Chris@0
|
117 * address a missing dependency. To address large amounts of dependencies
|
Chris@0
|
118 * subscribers can call
|
Chris@0
|
119 * \Drupal\Core\Config\MissingContentEvent::stopPropagation() which will stop
|
Chris@0
|
120 * calling other events and guarantee that the configuration import batch will
|
Chris@0
|
121 * fire the event again to continue processing missing content dependencies.
|
Chris@0
|
122 *
|
Chris@0
|
123 * @see \Drupal\Core\Config\ConfigImporter::processMissingContent()
|
Chris@0
|
124 * @see \Drupal\Core\Config\MissingContentEvent
|
Chris@0
|
125 */
|
Chris@0
|
126 const IMPORT_MISSING_CONTENT = 'config.importer.missing_content';
|
Chris@0
|
127
|
Chris@0
|
128 /**
|
Chris@0
|
129 * Name of event fired to collect information on all config collections.
|
Chris@0
|
130 *
|
Chris@0
|
131 * This event allows modules to add to the list of configuration collections
|
Chris@0
|
132 * retrieved by \Drupal\Core\Config\ConfigManager::getConfigCollectionInfo().
|
Chris@0
|
133 * The event listener method receives a
|
Chris@0
|
134 * \Drupal\Core\Config\ConfigCollectionInfo instance.
|
Chris@0
|
135 *
|
Chris@0
|
136 * @Event
|
Chris@0
|
137 *
|
Chris@0
|
138 * @see \Drupal\Core\Config\ConfigCollectionInfo
|
Chris@0
|
139 * @see \Drupal\Core\Config\ConfigManager::getConfigCollectionInfo()
|
Chris@0
|
140 * @see \Drupal\Core\Config\ConfigFactoryOverrideBase
|
Chris@0
|
141 *
|
Chris@0
|
142 * @var string
|
Chris@0
|
143 */
|
Chris@0
|
144 const COLLECTION_INFO = 'config.collection_info';
|
Chris@0
|
145
|
Chris@0
|
146 }
|