You are here

public function RabbitHoleEntityPluginManager::__construct in Rabbit Hole 8

Same name and namespace in other branches
  1. 2.x src/Plugin/RabbitHoleEntityPluginManager.php \Drupal\rabbit_hole\Plugin\RabbitHoleEntityPluginManager::__construct()

Constructor for RabbitHoleEntityPluginManager objects.

Parameters

\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 to invoke the alter hook with.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

Overrides DefaultPluginManager::__construct

File

src/Plugin/RabbitHoleEntityPluginManager.php, line 35

Class

RabbitHoleEntityPluginManager
Provides the Rabbit hole entity plugin plugin manager.

Namespace

Drupal\rabbit_hole\Plugin

Code

public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_type_manager) {
  parent::__construct('Plugin/RabbitHoleEntityPlugin', $namespaces, $module_handler, 'Drupal\\rabbit_hole\\Plugin\\RabbitHoleEntityPluginInterface', 'Drupal\\rabbit_hole\\Annotation\\RabbitHoleEntityPlugin');
  $this
    ->alterInfo('rabbit_hole_rabbit_hole_entity_plugin_info');
  $this
    ->setCacheBackend($cache_backend, 'rabbit_hole_rabbit_hole_entity_plugin_plugins');
  $this->entityTypeManager = $entity_type_manager;
}