function ComponentPluginManager::__construct

Same name and namespace in other branches
  1. 11.x core/modules/sdc/src/ComponentPluginManager.php \Drupal\sdc\ComponentPluginManager::__construct()
  2. 11.x core/lib/Drupal/Core/Theme/ComponentPluginManager.php \Drupal\Core\Theme\ComponentPluginManager::__construct()

Constructs SdcPluginManager object.

Parameters

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

\Drupal\Core\Extension\ThemeHandlerInterface $themeHandler: The theme handler.

\Drupal\Core\Cache\CacheBackendInterface $cacheBackend: Cache backend instance to use.

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

\Drupal\Core\Theme\ThemeManagerInterface $themeManager: The theme manager.

\Drupal\sdc\ComponentNegotiator $componentNegotiator: The component negotiator.

\Drupal\Core\File\FileSystemInterface $fileSystem: The file system service.

\Drupal\sdc\Component\SchemaCompatibilityChecker $compatibilityChecker: The compatibility checker.

\Drupal\sdc\Component\ComponentValidator $componentValidator: The component validator.

string $appRoot: The application root.

Overrides DefaultPluginManager::__construct

File

core/modules/sdc/src/ComponentPluginManager.php, line 67

Class

ComponentPluginManager
Defines a plugin manager to deal with sdc.

Namespace

Drupal\sdc

Code

public function __construct(ModuleHandlerInterface $module_handler, ThemeHandlerInterface $themeHandler, CacheBackendInterface $cacheBackend, ConfigFactoryInterface $configFactory, ThemeManagerInterface $themeManager, ComponentNegotiator $componentNegotiator, FileSystemInterface $fileSystem, SchemaCompatibilityChecker $compatibilityChecker, ComponentValidator $componentValidator, string $appRoot) {
    // We are skipping the call to the parent constructor to avoid initializing
    // variables aimed for annotation discovery, that are unnecessary here.
    // Plugin managers using YAML discovery also skip the parent constructor,
    // like LinkRelationTypeManager.
    $this->moduleHandler = $module_handler;
    $this->factory = new ContainerFactory($this);
    $this->setCacheBackend($cacheBackend, 'sdc_plugins');
    // Note that we are intentionally skipping $this->alterInfo('sdc_info');
    // We want to ensure that everything related to a component is in the
    // single directory. If the alteration of a component is necessary,
    // component replacement is the preferred tool for that.
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.