3 namespace Drupal\Core\Config;
6 * Provides an interface for configuration manager.
8 interface ConfigManagerInterface {
11 * Returns the entity type of a configuration object.
14 * The configuration object name.
17 * Either the entity type name, or NULL if none match.
19 public function getEntityTypeIdByName($name);
22 * Loads a configuration entity using the configuration name.
25 * The configuration object name.
27 * @return \Drupal\Core\Entity\EntityInterface|null
28 * The configuration entity or NULL if it does not exist.
30 public function loadConfigEntityByName($name);
33 * Gets the entity manager.
35 * @return \Drupal\Core\Entity\EntityManagerInterface
38 public function getEntityManager();
41 * Gets the config factory.
43 * @return \Drupal\Core\Config\ConfigFactoryInterface
46 public function getConfigFactory();
49 * Creates a Diff object using the config data from the two storages.
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
64 * @return \Drupal\Component\Diff\Diff
65 * A Diff object using the config data from the two storages.
67 * @todo Make renderer injectable
69 * @see \Drupal\Core\Diff\DiffFormatter
71 public function diff(StorageInterface $source_storage, StorageInterface $target_storage, $source_name, $target_name = NULL, $collection = StorageInterface::DEFAULT_COLLECTION);
74 * Creates a configuration snapshot following a successful import.
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.
81 public function createSnapshot(StorageInterface $source_storage, StorageInterface $snapshot_storage);
84 * Uninstalls the configuration of a given extension.
87 * The extension type; e.g., 'module' or 'theme'.
89 * The name of the module or theme to install configuration for.
91 public function uninstall($type, $name);
94 * Creates and populates a ConfigDependencyManager object.
96 * The configuration dependency manager is populated with data from the active
99 * @return \Drupal\Core\Config\Entity\ConfigDependencyManager
101 public function getConfigDependencyManager();
104 * Finds config entities that are dependent on extensions or entities.
106 * @param string $type
107 * The type of dependency being checked. Either 'module', 'theme', 'config'
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.
114 * @return \Drupal\Core\Config\Entity\ConfigEntityDependency[]
115 * An array of configuration entity dependency objects.
117 public function findConfigEntityDependents($type, array $names);
120 * Finds config entities that are dependent on extensions or entities.
122 * @param string $type
123 * The type of dependency being checked. Either 'module', 'theme', 'config'
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.
130 * @return \Drupal\Core\Config\Entity\ConfigEntityInterface[]
131 * An array of dependencies as configuration entities.
133 public function findConfigEntityDependentsAsEntities($type, array $names);
136 * Lists which config entities to update and delete on removal of a dependency.
138 * @param string $type
139 * The type of dependency being checked. Either 'module', 'theme', 'config'
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.
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.
157 public function getConfigEntitiesToChangeOnDependencyRemoval($type, array $names, $dry_run = TRUE);
160 * Gets available collection information using the event system.
162 * @return \Drupal\Core\Config\ConfigCollectionInfo
163 * The object which contains information about the available collections.
165 public function getConfigCollectionInfo();
168 * Finds missing content dependencies declared in configuration entities.
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
175 public function findMissingContentDependencies();