You are here

public function InfoHookDecorator::__construct in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Plugin/Discovery/InfoHookDecorator.php \Drupal\Core\Plugin\Discovery\InfoHookDecorator::__construct()
  2. 9 core/lib/Drupal/Core/Plugin/Discovery/InfoHookDecorator.php \Drupal\Core\Plugin\Discovery\InfoHookDecorator::__construct()

Constructs an InfoHookDecorator object.

Parameters

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

string $hook: The name of the info hook to be invoked by this discovery instance.

File

core/lib/Drupal/Core/Plugin/Discovery/InfoHookDecorator.php, line 37

Class

InfoHookDecorator
Allows info hook implementations to enhance discovered plugin definitions.

Namespace

Drupal\Core\Plugin\Discovery

Code

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