YamlDirectoryDiscovery.php 1.1 KB

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