3 namespace Drupal\Core\Plugin\Discovery;
5 use Drupal\Component\Discovery\YamlDirectoryDiscovery as ComponentYamlDirectoryDiscovery;
8 * Allows multiple YAML files per directory to define plugin definitions.
10 class YamlDirectoryDiscovery extends YamlDiscovery {
13 * Constructs a YamlDirectoryDiscovery object.
15 * @param array $directories
16 * An array of directories to scan, keyed by the provider. The value can
17 * either be a string or an array of strings. The string values should be
18 * the path of a directory to scan.
19 * @param string $file_cache_key_suffix
20 * The file cache key suffix. This should be unique for each type of
23 * (optional) The key contained in the discovered data that identifies it.
26 public function __construct(array $directories, $file_cache_key_suffix, $key = 'id') {
27 // Intentionally does not call parent constructor as this class uses a
28 // different YAML discovery.
29 $this->discovery = new ComponentYamlDirectoryDiscovery($directories, $file_cache_key_suffix, $key);