function DirectoryWithMetadataPluginDiscovery::__construct

Same name in this branch
  1. 10 core/modules/sdc/src/Plugin/Discovery/DirectoryWithMetadataPluginDiscovery.php \Drupal\sdc\Plugin\Discovery\DirectoryWithMetadataPluginDiscovery::__construct()
Same name in other branches
  1. 11.x core/modules/sdc/src/Plugin/Discovery/DirectoryWithMetadataPluginDiscovery.php \Drupal\sdc\Plugin\Discovery\DirectoryWithMetadataPluginDiscovery::__construct()
  2. 11.x core/lib/Drupal/Core/Plugin/Discovery/DirectoryWithMetadataPluginDiscovery.php \Drupal\Core\Plugin\Discovery\DirectoryWithMetadataPluginDiscovery::__construct()

Constructs a DirectoryWithMetadataPluginDiscovery object.

Parameters

array $directories: An array of directories to scan, keyed by the provider. The value can either be a string or an array of strings. The string values should be the path of a directory to scan.

string $file_cache_key_suffix: The file cache key suffix. This should be unique for each type of discovery.

\Drupal\Core\File\FileSystemInterface $file_system: The file system service.

Overrides YamlDiscovery::__construct

File

core/lib/Drupal/Core/Plugin/Discovery/DirectoryWithMetadataPluginDiscovery.php, line 25

Class

DirectoryWithMetadataPluginDiscovery
Discover directories that contain a specific metadata file.

Namespace

Drupal\Core\Plugin\Discovery

Code

public function __construct(array $directories, $file_cache_key_suffix, FileSystemInterface $file_system) {
    // Intentionally does not call parent constructor as this class uses a
    // different YAML discovery.
    $this->discovery = new DirectoryWithMetadataDiscovery($directories, $file_cache_key_suffix, $file_system);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.