protected function ConfigDependencyManager::createGraphConfigEntityDependencies

protected ConfigDependencyManager::createGraphConfigEntityDependencies($entities_to_check)

Creates a graph of config entity dependencies.

Parameters

array $entities_to_check: The configuration entity full configuration names to determine the dependencies for.

Return value

\Drupal\Core\Config\Entity\ConfigEntityDependency[] A graph of config entity dependency objects that are dependent on the supplied entities to check.

File

core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php, line 250

Class

ConfigDependencyManager
Provides a class to discover configuration entity dependencies.

Namespace

Drupal\Core\Config\Entity

Code

protected function createGraphConfigEntityDependencies($entities_to_check) {
  $dependent_entities = array();
  $graph = $this->getGraph();

  foreach ($entities_to_check as $entity) {
    if (isset($graph[$entity]) && !empty($graph[$entity]['paths'])) {
      foreach ($graph[$entity]['paths'] as $dependency => $value) {
        if (isset($this->data[$dependency])) {
          $dependent_entities[$dependency] = $this->data[$dependency];
        }
      }
    }
  }
  return $dependent_entities;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!Entity!ConfigDependencyManager.php/function/ConfigDependencyManager::createGraphConfigEntityDependencies/8.1.x