interface ConfigManagerInterface (View source)

Provides an interface for configuration manager.

Methods

string|null
getEntityTypeIdByName(string $name)

Returns the entity type of a configuration object.

loadConfigEntityByName(string $name)

Loads a configuration entity using the configuration name.

getEntityTypeManager()

Gets the entity type manager.

getConfigFactory()

Gets the config factory.

diff(StorageInterface $source_storage, StorageInterface $target_storage, string $source_name, string $target_name = NULL, string $collection = StorageInterface::DEFAULT_COLLECTION)

Creates a Diff object using the config data from the two storages.

createSnapshot(StorageInterface $source_storage, StorageInterface $snapshot_storage)

Creates a configuration snapshot following a successful import.

uninstall(string $type, string $name)

Uninstalls the configuration of a given extension.

getConfigDependencyManager()

Creates and populates a ConfigDependencyManager object.

findConfigEntityDependencies(string $type, array $names)

Finds config entities that are dependent on extensions or entities.

findConfigEntityDependenciesAsEntities(string $type, array $names)

Finds config entities that are dependent on extensions or entities.

findConfigEntityDependents(string $type, array $names) deprecated

Deprecated method to find config entity dependencies.

findConfigEntityDependentsAsEntities(string $type, array $names) deprecated

Deprecated method to find config entity dependencies as entities.

array
getConfigEntitiesToChangeOnDependencyRemoval(string $type, array $names, bool $dry_run = TRUE)

Lists which config entities to update and delete on removal of a dependency.

getConfigCollectionInfo()

Gets available collection information using the event system.

array
findMissingContentDependencies()

Finds missing content dependencies declared in configuration entities.

Details

string|null getEntityTypeIdByName(string $name)

Returns the entity type of a configuration object.

Parameters

string $name

The configuration object name.

Return Value

string|null

Either the entity type name, or NULL if none match.

EntityInterface|null loadConfigEntityByName(string $name)

Loads a configuration entity using the configuration name.

Parameters

string $name

The configuration object name.

Return Value

EntityInterface|null

The configuration entity or NULL if it does not exist.

EntityTypeManagerInterface getEntityTypeManager()

Gets the entity type manager.

Return Value

EntityTypeManagerInterface

The entity type manager.

ConfigFactoryInterface getConfigFactory()

Gets the config factory.

Return Value

ConfigFactoryInterface

The config factory.

Diff diff(StorageInterface $source_storage, StorageInterface $target_storage, string $source_name, string $target_name = NULL, string $collection = StorageInterface::DEFAULT_COLLECTION)

Creates a Diff object using the config data from the two storages.

Make renderer injectable

Parameters

StorageInterface $source_storage

The storage to diff configuration from.

StorageInterface $target_storage

The storage to diff configuration to.

string $source_name

The name of the configuration object in the source storage to diff.

string $target_name

(optional) The name of the configuration object in the target storage. If omitted, the source name is used.

string $collection

(optional) The configuration collection name. Defaults to the default collection.

Return Value

Diff

A Diff object using the config data from the two storages.

See also

DiffFormatter

createSnapshot(StorageInterface $source_storage, StorageInterface $snapshot_storage)

Creates a configuration snapshot following a successful import.

Parameters

StorageInterface $source_storage

The storage to synchronize configuration from.

StorageInterface $snapshot_storage

The storage to synchronize configuration to.

uninstall(string $type, string $name)

Uninstalls the configuration of a given extension.

Parameters

string $type

The extension type; e.g., 'module' or 'theme'.

string $name

The name of the module or theme to install configuration for.

ConfigDependencyManager getConfigDependencyManager()

Creates and populates a ConfigDependencyManager object.

The configuration dependency manager is populated with data from the active store.

ConfigEntityDependency[] findConfigEntityDependencies(string $type, array $names)

Finds config entities that are dependent on extensions or entities.

Parameters

string $type

The type of dependency being checked. Either 'module', 'theme', 'config' or 'content'.

array $names

The specific names to check. If $type equals 'module' or 'theme' then it should be a list of module names or theme names. In the case of 'config' or 'content' it should be a list of configuration dependency names.

Return Value

ConfigEntityDependency[]

An array of configuration entity dependency objects.

ConfigEntityInterface[] findConfigEntityDependenciesAsEntities(string $type, array $names)

Finds config entities that are dependent on extensions or entities.

Parameters

string $type

The type of dependency being checked. Either 'module', 'theme', 'config' or 'content'.

array $names

The specific names to check. If $type equals 'module' or 'theme' then it should be a list of module names or theme names. In the case of 'config' or 'content' it should be a list of configuration dependency names.

Return Value

ConfigEntityInterface[]

An array of dependencies as configuration entities.

ConfigEntityDependency[] findConfigEntityDependents(string $type, array $names) deprecated

deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Instead you should use ConfigManagerInterface::findConfigEntityDependencies().

Deprecated method to find config entity dependencies.

Parameters

string $type

The type of dependency being checked. Either 'module', 'theme', 'config' or 'content'.

array $names

The specific names to check. If $type equals 'module' or 'theme' then it should be a list of module names or theme names. In the case of 'config' or 'content' it should be a list of configuration dependency names.

Return Value

ConfigEntityDependency[]

An array of configuration entity dependency objects.

See also

https://www.drupal.org/node/3225357

ConfigEntityInterface[] findConfigEntityDependentsAsEntities(string $type, array $names) deprecated

deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Instead you should use ConfigManagerInterface::findConfigEntityDependenciesAsEntities().

Deprecated method to find config entity dependencies as entities.

Parameters

string $type

The type of dependency being checked. Either 'module', 'theme', 'config' or 'content'.

array $names

The specific names to check. If $type equals 'module' or 'theme' then it should be a list of module names or theme names. In the case of 'config' or 'content' it should be a list of configuration dependency names.

Return Value

ConfigEntityInterface[]

An array of dependencies as configuration entities.

See also

https://www.drupal.org/node/3225357

array getConfigEntitiesToChangeOnDependencyRemoval(string $type, array $names, bool $dry_run = TRUE)

Lists which config entities to update and delete on removal of a dependency.

Parameters

string $type

The type of dependency being checked. Either 'module', 'theme', 'config' or 'content'.

array $names

The specific names to check. If $type equals 'module' or 'theme' then it should be a list of module names or theme names. In the case of 'config' or 'content' it should be a list of configuration dependency names.

bool $dry_run

If set to FALSE the entities returned in the list of updates will be modified. In order to make the changes the caller needs to save them. If set to TRUE the entities returned will not be modified.

Return Value

array

An array with the keys: 'update', 'delete' and 'unchanged'. The value of each is a list of configuration entities that need to have that action applied when the supplied dependencies are removed. Updates need to be processed before deletes. The order of the deletes is significant and must be processed in the returned order.

ConfigCollectionInfo getConfigCollectionInfo()

Gets available collection information using the event system.

Return Value

ConfigCollectionInfo

The object which contains information about the available collections.

array findMissingContentDependencies()

Finds missing content dependencies declared in configuration entities.

Return Value

array

A list of missing content dependencies. The array is keyed by UUID. Each value is an array with the following keys: 'entity_type', 'bundle' and 'uuid'.