You are here

protected function ConfigDependencyManager::getGraph in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php \Drupal\Core\Config\Entity\ConfigDependencyManager::getGraph()

Gets the dependency graph of all the config entities.

Return value

array The dependency graph of all the config entities.

2 calls to ConfigDependencyManager::getGraph()
ConfigDependencyManager::createGraphConfigEntityDependencies in core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php
Creates a graph of config entity dependencies.
ConfigDependencyManager::sortAll in core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php
Sorts the dependencies in order of most dependent last.

File

core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php, line 251
Contains \Drupal\Core\Config\Entity\ConfigDependencyManager.

Class

ConfigDependencyManager
Provides a class to discover configuration entity dependencies.

Namespace

Drupal\Core\Config\Entity

Code

protected function getGraph() {
  if (!isset($this->graph)) {
    $graph = array();
    foreach ($this->data as $entity) {
      $graph_key = $entity
        ->getConfigDependencyName();
      $graph[$graph_key]['edges'] = array();
      $dependencies = $entity
        ->getDependencies('config');
      if (!empty($dependencies)) {
        foreach ($dependencies as $dependency) {
          $graph[$graph_key]['edges'][$dependency] = TRUE;
        }
      }
    }
    $graph_object = new Graph($graph);
    $this->graph = $graph_object
      ->searchAndSort();
  }
  return $this->graph;
}