function StaticDiscoveryDecorator::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php \Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator::__construct()
  2. 8.9.x core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php \Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator::__construct()
  3. 10 core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php \Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator::__construct()

Constructs a \Drupal\Component\Plugin\Discovery\StaticDiscoveryDecorator object.

Parameters

\Drupal\Component\Plugin\Discovery\DiscoveryInterface $decorated: The discovery object that is being decorated.

callable|null $registerDefinitions: (optional) A callback or closure used for registering additional definitions.

File

core/lib/Drupal/Component/Plugin/Discovery/StaticDiscoveryDecorator.php, line 33

Class

StaticDiscoveryDecorator
A decorator that allows manual registration of undiscoverable definitions.

Namespace

Drupal\Component\Plugin\Discovery

Code

public function __construct(DiscoveryInterface $decorated, $registerDefinitions = NULL) {
    $this->decorated = $decorated;
    $this->registerDefinitions = $registerDefinitions;
}

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