function ViewsHandlerDiscovery::__construct

Constructs a ViewsHandlerDiscovery object.

Parameters

string $type: The plugin type, for example filter.

\Traversable $root_namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations,

Overrides AnnotatedClassDiscovery::__construct

File

drupal/core/modules/views/lib/Drupal/views/Plugin/Discovery/ViewsHandlerDiscovery.php, line 40
Contains \Drupal\views\Plugin\Discovery\ViewsHandlerDiscovery.

Class

ViewsHandlerDiscovery
Defines a discovery mechanism to find Views handlers in PSR-0 namespaces.

Namespace

Drupal\views\Plugin\Discovery

Code

function __construct($type, \Traversable $root_namespaces) {
  $this->type = $type;
  $this->rootNamespacesIterator = $root_namespaces;
  $annotation_namespaces = array(
    'Drupal\\Component\\Annotation' => DRUPAL_ROOT . '/core/lib',
  );
  $plugin_namespaces = array();
  foreach ($root_namespaces as $namespace => $dir) {
    $plugin_namespaces["{$namespace}\\Plugin\\views\\{$type}"] = array(
      $dir,
    );
  }
  parent::__construct($plugin_namespaces, $annotation_namespaces, 'Drupal\\Component\\Annotation\\PluginID');
}