You are here

class YamlDirectoryDiscovery in Drupal 9

Same name in this branch
  1. 9 core/lib/Drupal/Component/Discovery/YamlDirectoryDiscovery.php \Drupal\Component\Discovery\YamlDirectoryDiscovery
  2. 9 core/lib/Drupal/Core/Plugin/Discovery/YamlDirectoryDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDirectoryDiscovery
Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Plugin/Discovery/YamlDirectoryDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDirectoryDiscovery

Allows multiple YAML files per directory to define plugin definitions.

Hierarchy

Expanded class hierarchy of YamlDirectoryDiscovery

2 files declare their use of YamlDirectoryDiscovery
MigrationPluginManager.php in core/modules/migrate/src/Plugin/MigrationPluginManager.php
YamlDirectoryDiscoveryTest.php in core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDirectoryDiscoveryTest.php

File

core/lib/Drupal/Core/Plugin/Discovery/YamlDirectoryDiscovery.php, line 10

Namespace

Drupal\Core\Plugin\Discovery
View source
class YamlDirectoryDiscovery extends YamlDiscovery {

  /**
   * Constructs a YamlDirectoryDiscovery object.
   *
   * @param 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.
   * @param string $file_cache_key_suffix
   *   The file cache key suffix. This should be unique for each type of
   *   discovery.
   * @param string $key
   *   (optional) The key contained in the discovered data that identifies it.
   *   Defaults to 'id'.
   */
  public function __construct(array $directories, $file_cache_key_suffix, $key = 'id') {

    // Intentionally does not call parent constructor as this class uses a
    // different YAML discovery.
    $this->discovery = new ComponentYamlDirectoryDiscovery($directories, $file_cache_key_suffix, $key);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DiscoveryTrait::doGetDefinition protected function Gets a specific plugin definition.
DiscoveryTrait::getDefinition public function 3
DiscoveryTrait::hasDefinition public function
YamlDirectoryDiscovery::__construct public function Constructs a YamlDirectoryDiscovery object. Overrides YamlDiscovery::__construct
YamlDiscovery::$discovery protected property YAML file discovery and parsing handler.
YamlDiscovery::$translatableProperties protected property Contains an array of translatable properties passed along to t().
YamlDiscovery::addTranslatableProperty public function Set one of the YAML values as being translatable.
YamlDiscovery::getDefinitions public function Gets the definition of all plugins for this type. Overrides DiscoveryTrait::getDefinitions 1