Drupal 8  8.0.2
ConfigManager Class Reference
Inheritance diagram for ConfigManager:

Public Member Functions

 __construct (EntityManagerInterface $entity_manager, ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config_manager, TranslationInterface $string_translation, StorageInterface $active_storage, EventDispatcherInterface $event_dispatcher)
 
 getEntityTypeIdByName ($name)
 
 loadConfigEntityByName ($name)
 
 getEntityManager ()
 
 getConfigFactory ()
 
 diff (StorageInterface $source_storage, StorageInterface $target_storage, $source_name, $target_name=NULL, $collection=StorageInterface::DEFAULT_COLLECTION)
 
 createSnapshot (StorageInterface $source_storage, StorageInterface $snapshot_storage)
 
 getConfigDependencyManager ()
 
 findConfigEntityDependents ($type, array $names, ConfigDependencyManager $dependency_manager=NULL)
 
 findConfigEntityDependentsAsEntities ($type, array $names, ConfigDependencyManager $dependency_manager=NULL)
 
 getConfigCollectionInfo ()
 
 findMissingContentDependencies ()
 
- Public Member Functions inherited from ConfigManagerInterface
 uninstall ($type, $name)
 
 findConfigEntityDependents ($type, array $names)
 
 findConfigEntityDependentsAsEntities ($type, array $names)
 
 getConfigEntitiesToChangeOnDependencyRemoval ($type, array $names, $dry_run=TRUE)
 

Protected Member Functions

 callOnDependencyRemoval (ConfigEntityInterface $entity, array $dependent_entities, $type, array $names)
 

Protected Attributes

 $entityManager
 
 $configFactory
 
 $typedConfigManager
 
 $activeStorage
 
 $eventDispatcher
 
 $configCollectionInfo
 
 $storages
 

Detailed Description

The ConfigManager provides helper functions for the configuration system.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $entity_manager,
ConfigFactoryInterface  $config_factory,
TypedConfigManagerInterface  $typed_config_manager,
TranslationInterface  $string_translation,
StorageInterface  $active_storage,
EventDispatcherInterface  $event_dispatcher 
)

Creates ConfigManager objects.

Parameters
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.
\Drupal\Core\Config\ConfigFactoryInterface$config_factoryThe configuration factory.
\Drupal\Core\Config\TypedConfigManagerInterface$typed_config_managerThe typed config manager.
\Drupal\Core\StringTranslation\TranslationInterface$string_translationThe string translation service.
\Drupal\Core\Config\StorageInterface$active_storageThe active configuration storage.
\Symfony\Component\EventDispatcher\EventDispatcherInterface$event_dispatcherThe event dispatcher.

References Drupal\configFactory(), and Drupal\entityManager().

Here is the call graph for this function:

Member Function Documentation

callOnDependencyRemoval ( ConfigEntityInterface  $entity,
array  $dependent_entities,
  $type,
array  $names 
)
protected

Calls an entity's onDependencyRemoval() method.

A helper method to call onDependencyRemoval() with the correct list of affected entities. This list should only contain dependencies on the entity. Configuration and content entity dependencies will be converted into entity objects.

Parameters
\Drupal\Core\Config\Entity\ConfigEntityInterface$entityThe entity to call onDependencyRemoval() on.
\Drupal\Core\Config\Entity\ConfigEntityInterface[]$dependent_entities The list of dependent configuration entities.
string$typeThe type of dependency being checked. Either 'module', 'theme', 'config' or 'content'.
array$namesThe 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.
Returns
bool TRUE if the entity has changed as a result of calling the onDependencyRemoval() method, FALSE if not.

References Drupal\entityManager(), EntityInterface\getConfigDependencyName(), ConfigEntityInterface\getDependencies(), ConfigManager\loadConfigEntityByName(), and ConfigEntityInterface\onDependencyRemoval().

Here is the call graph for this function:

createSnapshot ( StorageInterface  $source_storage,
StorageInterface  $snapshot_storage 
)

{Creates a configuration snapshot following a successful import.

Parameters
\Drupal\Core\Config\StorageInterface$source_storageThe storage to synchronize configuration from.
\Drupal\Core\Config\StorageInterface$snapshot_storageThe storage to synchronize configuration to.
}

Implements ConfigManagerInterface.

References StorageInterface\createCollection(), StorageInterface\deleteAll(), StorageInterface\getAllCollectionNames(), StorageInterface\listAll(), StorageInterface\read(), and StorageInterface\write().

Here is the call graph for this function:

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

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

Parameters
\Drupal\Core\Config\StorageInterface$source_storageThe storage to diff configuration from.
\Drupal\Core\Config\StorageInterface$target_storageThe storage to diff configuration to.
string$source_nameThe 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.
Returns
A Diff object using the config data from the two storages.
Todo:
Make renderer injectable
See Also
}

Implements ConfigManagerInterface.

References StorageInterface\createCollection(), StorageInterface\DEFAULT_COLLECTION, Yaml\encode(), StorageInterface\read(), and t().

Here is the call graph for this function:

findConfigEntityDependents (   $type,
array  $names,
ConfigDependencyManager  $dependency_manager = NULL 
)

{}

References ConfigManager\getConfigDependencyManager().

Referenced by ConfigManager\findConfigEntityDependentsAsEntities().

Here is the call graph for this function:

Here is the caller graph for this function:

findConfigEntityDependentsAsEntities (   $type,
array  $names,
ConfigDependencyManager  $dependency_manager = NULL 
)

{}

References Drupal\entityManager(), ConfigManager\findConfigEntityDependents(), and ConfigManager\getEntityTypeIdByName().

Here is the call graph for this function:

findMissingContentDependencies ( )

{Finds missing content dependencies declared in configuration entities.

Returns
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'.
}

Implements ConfigManagerInterface.

References Drupal\entityManager().

Here is the call graph for this function:

getConfigCollectionInfo ( )

{Gets available collection information using the event system.

Returns
The object which contains information about the available collections.
}

Implements ConfigManagerInterface.

getConfigDependencyManager ( )

{Creates and populates a ConfigDependencyManager object.The configuration dependency manager is populated with data from the active store.

Returns
}

Implements ConfigManagerInterface.

References Drupal\configFactory().

Referenced by ConfigManager\findConfigEntityDependents().

Here is the call graph for this function:

Here is the caller graph for this function:

getConfigFactory ( )

{Gets the config factory.

Returns
The entity manager.
}

Implements ConfigManagerInterface.

getEntityManager ( )

{Gets the entity manager.

Returns
The entity manager.
}

Implements ConfigManagerInterface.

getEntityTypeIdByName (   $name)

{Returns the entity type of a configuration object.

Parameters
string$nameThe configuration object name.
Returns
string|null Either the entity type name, or NULL if none match.
}

Implements ConfigManagerInterface.

References Drupal\entityManager(), and ConfigEntityTypeInterface\getConfigPrefix().

Referenced by ConfigManager\findConfigEntityDependentsAsEntities(), and ConfigManager\loadConfigEntityByName().

Here is the call graph for this function:

Here is the caller graph for this function:

loadConfigEntityByName (   $name)

{Loads a configuration entity using the configuration name.

Parameters
string$nameThe configuration object name.
Returns
|null The configuration entity or NULL if it does not exist.
}

Implements ConfigManagerInterface.

References Drupal\entityManager(), and ConfigManager\getEntityTypeIdByName().

Referenced by ConfigManager\callOnDependencyRemoval().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: