function YamlDiscovery::__construct

Same name in this branch
  1. 10 core/lib/Drupal/Component/Discovery/YamlDiscovery.php \Drupal\Component\Discovery\YamlDiscovery::__construct()
Same name in other branches
  1. 9 core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDiscovery::__construct()
  2. 9 core/lib/Drupal/Component/Discovery/YamlDiscovery.php \Drupal\Component\Discovery\YamlDiscovery::__construct()
  3. 8.9.x core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDiscovery::__construct()
  4. 8.9.x core/lib/Drupal/Component/Discovery/YamlDiscovery.php \Drupal\Component\Discovery\YamlDiscovery::__construct()
  5. 11.x core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDiscovery::__construct()
  6. 11.x core/lib/Drupal/Component/Discovery/YamlDiscovery.php \Drupal\Component\Discovery\YamlDiscovery::__construct()

Construct a YamlDiscovery object.

Parameters

string $name: The file name suffix to use for discovery; for example, 'test' will become 'MODULE.test.yml'.

array $directories: An array of directories to scan.

1 call to YamlDiscovery::__construct()
YamlDiscoveryDecorator::__construct in core/lib/Drupal/Core/Plugin/Discovery/YamlDiscoveryDecorator.php
Constructs a YamlDiscoveryDecorator object.
4 methods override YamlDiscovery::__construct()
DirectoryWithMetadataPluginDiscovery::__construct in core/modules/sdc/src/Plugin/Discovery/DirectoryWithMetadataPluginDiscovery.php
Constructs a YamlDirectoryDiscovery object.
DirectoryWithMetadataPluginDiscovery::__construct in core/lib/Drupal/Core/Plugin/Discovery/DirectoryWithMetadataPluginDiscovery.php
Constructs a DirectoryWithMetadataPluginDiscovery object.
YamlDirectoryDiscovery::__construct in core/lib/Drupal/Core/Plugin/Discovery/YamlDirectoryDiscovery.php
Constructs a YamlDirectoryDiscovery object.
YamlDiscoveryDecorator::__construct in core/lib/Drupal/Core/Plugin/Discovery/YamlDiscoveryDecorator.php
Constructs a YamlDiscoveryDecorator object.

File

core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php, line 50

Class

YamlDiscovery
Allows YAML files to define plugin definitions.

Namespace

Drupal\Core\Plugin\Discovery

Code

public function __construct($name, array $directories) {
    $this->discovery = new CoreYamlDiscovery($name, $directories);
}

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