You are here

public function FeaturesExtensionStorages::listExtensionConfig in Features 8.4

Same name and namespace in other branches
  1. 8.3 src/FeaturesExtensionStorages.php \Drupal\features\FeaturesExtensionStorages::listExtensionConfig()

Lists names of configuration objects provided by a given extension.

If a $name and/or $namespace is specified, only matching modules will be returned. Otherwise, all install are returned.

Parameters

mixed $extension: A string name of an extension or a full Extension object.

Return value

array An array of configuration object names.

Overrides FeaturesExtensionStoragesInterface::listExtensionConfig

File

src/FeaturesExtensionStorages.php, line 82

Class

FeaturesExtensionStorages
Wraps FeaturesInstallStorage to support multiple configuration directories.

Namespace

Drupal\features

Code

public function listExtensionConfig(Extension $extension) {
  $extension_config = [];
  foreach ($this->extensionStorages as $directory => $extension_storage) {
    $extension_config = array_merge($extension_config, array_keys($extension_storage
      ->getComponentNames([
      $extension
        ->getName() => $extension,
    ])));
  }
  return $extension_config;
}