You are here

public function LayoutBuilderRestrictionManager::__construct in Layout Builder Restrictions 8.2

Constructs a new LayoutBuilderRestrictionManager object.

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\Config\ConfigFactoryInterface $config_factory: The config factory to load plugin configuration.

Overrides DefaultPluginManager::__construct

File

src/Plugin/LayoutBuilderRestrictionManager.php, line 39

Class

LayoutBuilderRestrictionManager
Provides the Layout builder restriction plugin plugin manager.

Namespace

Drupal\layout_builder_restrictions\Plugin

Code

public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory) {
  parent::__construct('Plugin/LayoutBuilderRestriction', $namespaces, $module_handler, 'Drupal\\layout_builder_restrictions\\Plugin\\LayoutBuilderRestrictionInterface', 'Drupal\\layout_builder_restrictions\\Annotation\\LayoutBuilderRestriction');
  $this->configFactory = $config_factory;
  $this
    ->alterInfo('layout_builder_restrictions_layout_builder_restriction_info');
  $this
    ->setCacheBackend($cache_backend, 'layout_builder_restriction_plugins');
}