You are here

protected function FeaturesManager::getFeaturesConfigDependencyManager in Features 8.3

Same name and namespace in other branches
  1. 8.4 src/FeaturesManager.php \Drupal\features\FeaturesManager::getFeaturesConfigDependencyManager()

Creates a high performant version of the ConfigDependencyManager.

Return value

\Drupal\features\FeaturesConfigDependencyManager A high performant version of the ConfigDependencyManager.

See also

\Drupal\Core\Config\Entity\ConfigDependencyManager

1 call to FeaturesManager::getFeaturesConfigDependencyManager()
FeaturesManager::initConfigCollection in src/FeaturesManager.php
Loads configuration from storage into a property.

File

src/FeaturesManager.php, line 1192

Class

FeaturesManager
The FeaturesManager provides helper functions for building packages.

Namespace

Drupal\features

Code

protected function getFeaturesConfigDependencyManager() {
  $dependency_manager = new FeaturesConfigDependencyManager();

  // Read all configuration using the factory. This ensures that multiple
  // deletes during the same request benefit from the static cache. Using the
  // factory also ensures configuration entity dependency discovery has no
  // dependencies on the config entity classes. Assume data with UUID is a
  // config entity. Only configuration entities can be depended on so we can
  // ignore everything else.
  $data = array_map(function (ImmutableConfig $config) {
    $data = $config
      ->get();
    if (isset($data['uuid'])) {
      return $data;
    }
    return FALSE;
  }, $this->configFactory
    ->loadMultiple($this->configStorage
    ->listAll()));
  $dependency_manager
    ->setData(array_filter($data));
  return $dependency_manager;
}