comparison core/lib/Drupal/Core/Config/ConfigManagerInterface.php @ 0:4c8ae668cc8c

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