You are here

public function DiffBuilderManager::__construct in Diff 8

Constructs a DiffBuilderManager 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 config factory.

Overrides DefaultPluginManager::__construct

File

src/DiffBuilderManager.php, line 71

Class

DiffBuilderManager
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/Field', $namespaces, $module_handler, '\\Drupal\\diff\\FieldDiffBuilderInterface', 'Drupal\\diff\\Annotation\\FieldDiffBuilder');
  $this
    ->setCacheBackend($cache_backend, 'field_diff_builder_plugins');
  $this
    ->alterInfo('field_diff_builder_info');
  $this->entityTypeManager = $entity_type_manager;
  $this->config = $config_factory
    ->get('diff.settings');
  $this->pluginsConfig = $config_factory
    ->get('diff.plugins');
}