public function AlterDecorator::__construct

Constructs a Drupal\Core\Plugin\Discovery\AlterDecorator object.

It uses the DiscoveryInterface object it should decorate.

Parameters

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

string $hook: The name of the alter hook that will be used by this discovery instance.

File

drupal/core/lib/Drupal/Core/Plugin/Discovery/AlterDecorator.php, line 40
Definition of Drupal\Core\Plugin\Discovery\AlterDiscoveryDecorator.

Class

AlterDecorator
Enables altering of discovered plugin definitions.

Namespace

Drupal\Core\Plugin\Discovery

Code

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