Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AttributeDiscoveryWithAnnotations.php

function AttributeDiscoveryWithAnnotations::__construct

Constructs an AttributeDiscoveryWithAnnotations object.

Parameters

string $subdir: Either the plugin's subdirectory, for example 'Plugin/views/filter', or empty string if plugins are located at the top level of the namespace.

\Traversable $rootNamespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations. If $subdir is not an empty string, it will be appended to each namespace.

string $pluginDefinitionAttributeName: (optional) The name of the attribute that contains the plugin definition. Defaults to 'Drupal\Component\Plugin\Attribute\Plugin'.

string $pluginDefinitionAnnotationName: (optional) The name of the attribute that contains the plugin definition. Defaults to 'Drupal\Component\Annotation\Plugin'.

string[] $additionalNamespaces: (optional) Additional namespaces to scan for attribute definitions.

Overrides AttributeClassDiscovery::__construct

File

core/lib/Drupal/Core/Plugin/Discovery/AttributeDiscoveryWithAnnotations.php, line 43

Class

AttributeDiscoveryWithAnnotations
Enables both attribute and annotation discovery for plugin definitions.

Namespace

Drupal\Core\Plugin\Discovery

Code

public function __construct(string $subdir, \Traversable $rootNamespaces, string $pluginDefinitionAttributeName = 'Drupal\\Component\\Plugin\\Attribute\\Plugin', string $pluginDefinitionAnnotationName = 'Drupal\\Component\\Annotation\\Plugin', array $additionalNamespaces = []) {
    parent::__construct($subdir, $rootNamespaces, $pluginDefinitionAttributeName);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal