You are here

public function AggregatorPluginManager::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/aggregator/src/Plugin/AggregatorPluginManager.php \Drupal\aggregator\Plugin\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.

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

Overrides DefaultPluginManager::__construct

File

core/modules/aggregator/src/Plugin/AggregatorPluginManager.php, line 36

Class

AggregatorPluginManager
Manages aggregator plugins.

Namespace

Drupal\aggregator\Plugin

Code

public function __construct($type, \Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
  $type_annotations = [
    'fetcher' => 'Drupal\\aggregator\\Annotation\\AggregatorFetcher',
    'parser' => 'Drupal\\aggregator\\Annotation\\AggregatorParser',
    'processor' => 'Drupal\\aggregator\\Annotation\\AggregatorProcessor',
  ];
  $plugin_interfaces = [
    'fetcher' => 'Drupal\\aggregator\\Plugin\\FetcherInterface',
    'parser' => 'Drupal\\aggregator\\Plugin\\ParserInterface',
    'processor' => 'Drupal\\aggregator\\Plugin\\ProcessorInterface',
  ];
  parent::__construct("Plugin/aggregator/{$type}", $namespaces, $module_handler, $plugin_interfaces[$type], $type_annotations[$type]);
  $this
    ->alterInfo('aggregator_' . $type . '_info');
  $this
    ->setCacheBackend($cache_backend, 'aggregator_' . $type . '_plugins');
}