You are here

public function EntityTraitManager::__construct in Commerce Core 8.2

Constructs a new EntityTraitManager 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: The cache backend.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\commerce\ConfigurableFieldManagerInterface $configurable_field_manager: The configurable field manager.

Overrides DefaultPluginManager::__construct

File

src/EntityTraitManager.php, line 39

Class

EntityTraitManager
Manages discovery and instantiation of entity trait plugins.

Namespace

Drupal\commerce

Code

public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ConfigurableFieldManagerInterface $configurable_field_manager) {
  parent::__construct('Plugin/Commerce/EntityTrait', $namespaces, $module_handler, 'Drupal\\commerce\\Plugin\\Commerce\\EntityTrait\\EntityTraitInterface', 'Drupal\\commerce\\Annotation\\CommerceEntityTrait');
  $this
    ->alterInfo('commerce_entity_trait_info');
  $this
    ->setCacheBackend($cache_backend, 'commerce_entity_trait_plugins');
  $this->configurableFieldManager = $configurable_field_manager;
}