You are here

public function AccessFilterPluginManager::__construct in Access Filter 8

Constructs a new AccessFilterPluginManager 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

src/Plugin/AccessFilterPluginManager.php, line 33

Class

AccessFilterPluginManager
Manages access filter plugins.

Namespace

Drupal\access_filter\Plugin

Code

public function __construct($type, \Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
  $type_annotations = [
    'condition' => 'Drupal\\access_filter\\Annotation\\AccessFilterCondition',
    'rule' => 'Drupal\\access_filter\\Annotation\\AccessFilterRule',
  ];
  $plugin_interfaces = [
    'condition' => 'Drupal\\access_filter\\Plugin\\ConditionInterface',
    'rule' => 'Drupal\\access_filter\\Plugin\\RuleInterface',
  ];
  parent::__construct('Plugin/AccessFilter/' . ucwords($type, '_'), $namespaces, $module_handler, $plugin_interfaces[$type], $type_annotations[$type]);
  $this
    ->setCacheBackend($cache_backend, 'access_filter_' . $type . '_plugins');
}