You are here

public function DiffLayoutManager::__construct in Diff 8

Constructs a DiffLayoutManager 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.

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

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The configuration factory.

Overrides DefaultPluginManager::__construct

File

src/DiffLayoutManager.php, line 54

Class

DiffLayoutManager
Plugin type manager for field diff builders.

Namespace

Drupal\diff

Code

public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_type_manager, ConfigFactoryInterface $config_factory) {
  parent::__construct('Plugin/diff/Layout', $namespaces, $module_handler, '\\Drupal\\diff\\DiffLayoutInterface', 'Drupal\\diff\\Annotation\\DiffLayoutBuilder');
  $this
    ->setCacheBackend($cache_backend, 'diff_layout_builder_plugins');
  $this
    ->alterInfo('diff_layout_builder_info');
  $this->entityTypeManager = $entity_type_manager;
  $this->config = $config_factory
    ->get('diff.settings');
  $this->layoutPluginsConfig = $config_factory
    ->get('diff.layout_plugins');
}