public function BlockManager::__construct

Constructs a new \Drupal\block\Plugin\Type\BlockManager object.

Parameters

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

File

drupal/core/modules/block/lib/Drupal/block/Plugin/Type/BlockManager.php, line 34

Class

BlockManager
Manages discovery and instantiation of block plugins.

Namespace

Drupal\block\Plugin\Type

Code

public function __construct(\Traversable $namespaces) {
  $this->discovery = new AnnotatedClassDiscovery('Block', $namespaces);
  $this->discovery = new DerivativeDiscoveryDecorator($this->discovery);
  $this->discovery = new AlterDecorator($this->discovery, 'block');
  $this->discovery = new CacheDecorator($this->discovery, 'block_plugins:' . language(Language::TYPE_INTERFACE)->langcode, 'block', CacheBackendInterface::CACHE_PERMANENT, array(
    'block',
  ));
  $this->factory = new DefaultFactory($this->discovery);
}