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