class YamlDirectoryDiscovery

Same name in this branch
  1. 11.x core/lib/Drupal/Component/Discovery/YamlDirectoryDiscovery.php \Drupal\Component\Discovery\YamlDirectoryDiscovery
Same name in other branches
  1. 9 core/lib/Drupal/Core/Plugin/Discovery/YamlDirectoryDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDirectoryDiscovery
  2. 9 core/lib/Drupal/Component/Discovery/YamlDirectoryDiscovery.php \Drupal\Component\Discovery\YamlDirectoryDiscovery
  3. 8.9.x core/lib/Drupal/Core/Plugin/Discovery/YamlDirectoryDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDirectoryDiscovery
  4. 8.9.x core/lib/Drupal/Component/Discovery/YamlDirectoryDiscovery.php \Drupal\Component\Discovery\YamlDirectoryDiscovery
  5. 10 core/lib/Drupal/Core/Plugin/Discovery/YamlDirectoryDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDirectoryDiscovery
  6. 10 core/lib/Drupal/Component/Discovery/YamlDirectoryDiscovery.php \Drupal\Component\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

Title Sort descending Modifiers Object type Summary Overriden Title 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 Overrides DiscoveryTrait::getDefinitions 1

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