diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php index fc76841..8f7eb1b 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php @@ -11,7 +11,40 @@ use Drupal\Component\Utility\SortArray; /** - * Class ConfigDependencyManager + * Provides a class to discover configuration entity dependencies. + * + * Configuration entities can depend on modules, themes and other configuration + * entities. The dependency system is used during configuration installation to + * ensure that configuration entities are imported in the correct order. For + * example, node types are created before their fields and the fields are + * created before their field instances. + * + * Dependencies are written to the configuration entity so that they can be + * checked without the module that provides the configuration entity class being + * installed. This is important for configuration synchronization which needs to + * be able to validate configuration in the staging directory before the + * synchronization has occurred. + * + * Configuration entities determine their dependencies by implementing + * \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies(). + * This method should be called from the entity's implementation of + * \Drupal\Core\Entity\EntityInterface::preSave(). Implementations should use + * the helper method + * \Drupal\Core\Config\Entity\ConfigEntityBase::addDependency() to add + * dependencies. All the implementations in core call the parent method + * \Drupal\Core\Config\Entity\ConfigEntityBase::calculateDependencies() which + * resets the dependencies and provides an implementation to determine the + * plugin providers for configuration entities that implement + * \Drupal\Core\Config\Entity\EntityWithPluginBagInterface. + * + * The configuration manager service provides methods to find dependencies for + * a specified module, theme or configuration entity. + * + * @see \Drupal\Core\Config\Entity\ConfigEntityInterface::calculateDependencies() + * @see \Drupal\Core\Config\Entity\ConfigEntityInterface::getConfigDependencyName() + * @see \Drupal\Core\Config\Entity\ConfigEntityBase::addDependency() + * @see \Drupal\Core\Config\ConfigInstaller::installDefaultConfig() + * @see \Drupal\Core\Config\Entity\ConfigEntityDependency */ class ConfigDependencyManager { @@ -168,6 +201,7 @@ public function setData(array $data) { $config = new ConfigEntityDependency($name, $config); }); $this->data = $data; + $this->graph = NULL; return $this; }