You are here

public function FruitPluginManager::__construct in Plug 7

Constructs FruitPluginManager.

Parameters

\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations.

\DrupalCacheInterface $cache_backend: Cache backend instance to use.

Overrides DefaultPluginManager::__construct

File

modules/plug_example/src/FruitPluginManager.php, line 45
Contains \Drupal\plug_example\FruitPluginManager.

Class

FruitPluginManager
Name plugin manager.

Namespace

Drupal\plug_example

Code

public function __construct(\Traversable $namespaces, \DrupalCacheInterface $cache_backend) {
  parent::__construct(FALSE, $namespaces);
  $this->discovery = new YamlDiscovery('fruits', Module::getDirectories());
  $this->factory = new ContainerFactory($this);
  $this
    ->alterInfo('fruit_plugin');
  $this
    ->setCacheBackend($cache_backend, 'fruit_plugins');
}