Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\Core\Config;
|
Chris@0
|
4
|
Chris@0
|
5 /**
|
Chris@0
|
6 * Provides an interface for configuration manager.
|
Chris@0
|
7 */
|
Chris@0
|
8 interface ConfigManagerInterface {
|
Chris@0
|
9
|
Chris@0
|
10 /**
|
Chris@0
|
11 * Returns the entity type of a configuration object.
|
Chris@0
|
12 *
|
Chris@0
|
13 * @param string $name
|
Chris@0
|
14 * The configuration object name.
|
Chris@0
|
15 *
|
Chris@0
|
16 * @return string|null
|
Chris@0
|
17 * Either the entity type name, or NULL if none match.
|
Chris@0
|
18 */
|
Chris@0
|
19 public function getEntityTypeIdByName($name);
|
Chris@0
|
20
|
Chris@0
|
21 /**
|
Chris@0
|
22 * Loads a configuration entity using the configuration name.
|
Chris@0
|
23 *
|
Chris@0
|
24 * @param string $name
|
Chris@0
|
25 * The configuration object name.
|
Chris@0
|
26 *
|
Chris@0
|
27 * @return \Drupal\Core\Entity\EntityInterface|null
|
Chris@0
|
28 * The configuration entity or NULL if it does not exist.
|
Chris@0
|
29 */
|
Chris@0
|
30 public function loadConfigEntityByName($name);
|
Chris@0
|
31
|
Chris@0
|
32 /**
|
Chris@0
|
33 * Gets the entity manager.
|
Chris@0
|
34 *
|
Chris@0
|
35 * @return \Drupal\Core\Entity\EntityManagerInterface
|
Chris@0
|
36 * The entity manager.
|
Chris@18
|
37 *
|
Chris@18
|
38 * @deprecated in Drupal 8.7.x, will be removed before Drupal 9.0.0. Use
|
Chris@18
|
39 * \Drupal\Core\Config\ConfigManagerInterface::getEntityTypeManager()
|
Chris@18
|
40 * instead.
|
Chris@0
|
41 */
|
Chris@0
|
42 public function getEntityManager();
|
Chris@0
|
43
|
Chris@0
|
44 /**
|
Chris@18
|
45 * Gets the entity type manager.
|
Chris@18
|
46 *
|
Chris@18
|
47 * @return \Drupal\Core\Entity\EntityTypeManagerInterface
|
Chris@18
|
48 * The entity type manager.
|
Chris@18
|
49 */
|
Chris@18
|
50 public function getEntityTypeManager();
|
Chris@18
|
51
|
Chris@18
|
52 /**
|
Chris@0
|
53 * Gets the config factory.
|
Chris@0
|
54 *
|
Chris@0
|
55 * @return \Drupal\Core\Config\ConfigFactoryInterface
|
Chris@18
|
56 * The config factory.
|
Chris@0
|
57 */
|
Chris@0
|
58 public function getConfigFactory();
|
Chris@0
|
59
|
Chris@0
|
60 /**
|
Chris@0
|
61 * Creates a Diff object using the config data from the two storages.
|
Chris@0
|
62 *
|
Chris@0
|
63 * @param \Drupal\Core\Config\StorageInterface $source_storage
|
Chris@0
|
64 * The storage to diff configuration from.
|
Chris@0
|
65 * @param \Drupal\Core\Config\StorageInterface $target_storage
|
Chris@0
|
66 * The storage to diff configuration to.
|
Chris@0
|
67 * @param string $source_name
|
Chris@0
|
68 * The name of the configuration object in the source storage to diff.
|
Chris@0
|
69 * @param string $target_name
|
Chris@0
|
70 * (optional) The name of the configuration object in the target storage.
|
Chris@0
|
71 * If omitted, the source name is used.
|
Chris@0
|
72 * @param string $collection
|
Chris@0
|
73 * (optional) The configuration collection name. Defaults to the default
|
Chris@0
|
74 * collection.
|
Chris@0
|
75 *
|
Chris@0
|
76 * @return \Drupal\Component\Diff\Diff
|
Chris@0
|
77 * A Diff object using the config data from the two storages.
|
Chris@0
|
78 *
|
Chris@0
|
79 * @todo Make renderer injectable
|
Chris@0
|
80 *
|
Chris@0
|
81 * @see \Drupal\Core\Diff\DiffFormatter
|
Chris@0
|
82 */
|
Chris@0
|
83 public function diff(StorageInterface $source_storage, StorageInterface $target_storage, $source_name, $target_name = NULL, $collection = StorageInterface::DEFAULT_COLLECTION);
|
Chris@0
|
84
|
Chris@0
|
85 /**
|
Chris@0
|
86 * Creates a configuration snapshot following a successful import.
|
Chris@0
|
87 *
|
Chris@0
|
88 * @param \Drupal\Core\Config\StorageInterface $source_storage
|
Chris@0
|
89 * The storage to synchronize configuration from.
|
Chris@0
|
90 * @param \Drupal\Core\Config\StorageInterface $snapshot_storage
|
Chris@0
|
91 * The storage to synchronize configuration to.
|
Chris@0
|
92 */
|
Chris@0
|
93 public function createSnapshot(StorageInterface $source_storage, StorageInterface $snapshot_storage);
|
Chris@0
|
94
|
Chris@0
|
95 /**
|
Chris@0
|
96 * Uninstalls the configuration of a given extension.
|
Chris@0
|
97 *
|
Chris@0
|
98 * @param string $type
|
Chris@0
|
99 * The extension type; e.g., 'module' or 'theme'.
|
Chris@0
|
100 * @param string $name
|
Chris@0
|
101 * The name of the module or theme to install configuration for.
|
Chris@0
|
102 */
|
Chris@0
|
103 public function uninstall($type, $name);
|
Chris@0
|
104
|
Chris@0
|
105 /**
|
Chris@0
|
106 * Creates and populates a ConfigDependencyManager object.
|
Chris@0
|
107 *
|
Chris@0
|
108 * The configuration dependency manager is populated with data from the active
|
Chris@0
|
109 * store.
|
Chris@0
|
110 *
|
Chris@0
|
111 * @return \Drupal\Core\Config\Entity\ConfigDependencyManager
|
Chris@0
|
112 */
|
Chris@0
|
113 public function getConfigDependencyManager();
|
Chris@0
|
114
|
Chris@0
|
115 /**
|
Chris@0
|
116 * Finds config entities that are dependent on extensions or entities.
|
Chris@0
|
117 *
|
Chris@0
|
118 * @param string $type
|
Chris@0
|
119 * The type of dependency being checked. Either 'module', 'theme', 'config'
|
Chris@0
|
120 * or 'content'.
|
Chris@0
|
121 * @param array $names
|
Chris@0
|
122 * The specific names to check. If $type equals 'module' or 'theme' then it
|
Chris@0
|
123 * should be a list of module names or theme names. In the case of 'config'
|
Chris@0
|
124 * or 'content' it should be a list of configuration dependency names.
|
Chris@0
|
125 *
|
Chris@0
|
126 * @return \Drupal\Core\Config\Entity\ConfigEntityDependency[]
|
Chris@0
|
127 * An array of configuration entity dependency objects.
|
Chris@0
|
128 */
|
Chris@0
|
129 public function findConfigEntityDependents($type, array $names);
|
Chris@0
|
130
|
Chris@0
|
131 /**
|
Chris@0
|
132 * Finds config entities that are dependent on extensions or entities.
|
Chris@0
|
133 *
|
Chris@0
|
134 * @param string $type
|
Chris@0
|
135 * The type of dependency being checked. Either 'module', 'theme', 'config'
|
Chris@0
|
136 * or 'content'.
|
Chris@0
|
137 * @param array $names
|
Chris@0
|
138 * The specific names to check. If $type equals 'module' or 'theme' then it
|
Chris@0
|
139 * should be a list of module names or theme names. In the case of 'config'
|
Chris@0
|
140 * or 'content' it should be a list of configuration dependency names.
|
Chris@0
|
141 *
|
Chris@0
|
142 * @return \Drupal\Core\Config\Entity\ConfigEntityInterface[]
|
Chris@0
|
143 * An array of dependencies as configuration entities.
|
Chris@0
|
144 */
|
Chris@0
|
145 public function findConfigEntityDependentsAsEntities($type, array $names);
|
Chris@0
|
146
|
Chris@0
|
147 /**
|
Chris@0
|
148 * Lists which config entities to update and delete on removal of a dependency.
|
Chris@0
|
149 *
|
Chris@0
|
150 * @param string $type
|
Chris@0
|
151 * The type of dependency being checked. Either 'module', 'theme', 'config'
|
Chris@0
|
152 * or 'content'.
|
Chris@0
|
153 * @param array $names
|
Chris@0
|
154 * The specific names to check. If $type equals 'module' or 'theme' then it
|
Chris@0
|
155 * should be a list of module names or theme names. In the case of 'config'
|
Chris@0
|
156 * or 'content' it should be a list of configuration dependency names.
|
Chris@0
|
157 * @param bool $dry_run
|
Chris@0
|
158 * If set to FALSE the entities returned in the list of updates will be
|
Chris@0
|
159 * modified. In order to make the changes the caller needs to save them. If
|
Chris@0
|
160 * set to TRUE the entities returned will not be modified.
|
Chris@0
|
161 *
|
Chris@0
|
162 * @return array
|
Chris@0
|
163 * An array with the keys: 'update', 'delete' and 'unchanged'. The value of
|
Chris@0
|
164 * each is a list of configuration entities that need to have that action
|
Chris@0
|
165 * applied when the supplied dependencies are removed. Updates need to be
|
Chris@0
|
166 * processed before deletes. The order of the deletes is significant and
|
Chris@0
|
167 * must be processed in the returned order.
|
Chris@0
|
168 */
|
Chris@0
|
169 public function getConfigEntitiesToChangeOnDependencyRemoval($type, array $names, $dry_run = TRUE);
|
Chris@0
|
170
|
Chris@0
|
171 /**
|
Chris@0
|
172 * Gets available collection information using the event system.
|
Chris@0
|
173 *
|
Chris@0
|
174 * @return \Drupal\Core\Config\ConfigCollectionInfo
|
Chris@0
|
175 * The object which contains information about the available collections.
|
Chris@0
|
176 */
|
Chris@0
|
177 public function getConfigCollectionInfo();
|
Chris@0
|
178
|
Chris@0
|
179 /**
|
Chris@0
|
180 * Finds missing content dependencies declared in configuration entities.
|
Chris@0
|
181 *
|
Chris@0
|
182 * @return array
|
Chris@0
|
183 * A list of missing content dependencies. The array is keyed by UUID. Each
|
Chris@0
|
184 * value is an array with the following keys: 'entity_type', 'bundle' and
|
Chris@0
|
185 * 'uuid'.
|
Chris@0
|
186 */
|
Chris@0
|
187 public function findMissingContentDependencies();
|
Chris@0
|
188
|
Chris@0
|
189 }
|