public function AggregatorPluginManager::__construct

Constructs a AggregatorPluginManager object.

Parameters

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

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

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Plugin/AggregatorPluginManager.php, line 30
Contains \Drupal\aggregator\Plugin\AggregatorPluginManager.

Class

AggregatorPluginManager
Manages aggregator plugins.

Namespace

Drupal\aggregator\Plugin

Code

public function __construct($type, \Traversable $namespaces) {
  $type_annotations = array(
    'fetcher' => 'Drupal\\aggregator\\Annotation\\AggregatorFetcher',
    'parser' => 'Drupal\\aggregator\\Annotation\\AggregatorParser',
    'processor' => 'Drupal\\aggregator\\Annotation\\AggregatorProcessor',
  );
  $annotation_namespaces = array(
    'Drupal\\aggregator\\Annotation' => DRUPAL_ROOT . '/core/modules/aggregator/lib',
  );
  $this->discovery = new AnnotatedClassDiscovery("aggregator/{$type}", $namespaces, $annotation_namespaces, $type_annotations[$type]);
  $this->discovery = new CacheDecorator($this->discovery, "aggregator_{$type}:" . language(Language::TYPE_INTERFACE)->langcode);
  $this->factory = new DefaultFactory($this->discovery);
}