You are here

public function AnalyticsServiceManager::__construct in Analytics 8

Constructs a new AnalyticsServiceManager 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.

Overrides DefaultPluginManager::__construct

File

src/AnalyticsServiceManager.php, line 32

Class

AnalyticsServiceManager
Provides a plugin manager for analytics items.

Namespace

Drupal\analytics

Code

public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
  parent::__construct('Plugin/AnalyticsService', $namespaces, $module_handler, ServicePluginInterface::class, ServicePluginAnnotation::class);
  $this
    ->alterInfo('analytics_service_info');
  $this
    ->setCacheBackend($cache_backend, 'analytics_service_plugins');
}