You are here

public function PreprocessEventFactoryMapper::addFactory in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/preprocess_event_dispatcher/src/Service/PreprocessEventFactoryMapper.php \Drupal\preprocess_event_dispatcher\Service\PreprocessEventFactoryMapper::addFactory()

Add Factory to the mapper.

Parameters

\Drupal\preprocess_event_dispatcher\Factory\PreprocessEventFactoryInterface $factory: Provided factory to add.

File

modules/preprocess_event_dispatcher/src/Service/PreprocessEventFactoryMapper.php, line 25

Class

PreprocessEventFactoryMapper
Class PreprocessEventFactoryMapper.

Namespace

Drupal\preprocess_event_dispatcher\Service

Code

public function addFactory(PreprocessEventFactoryInterface $factory) : void {
  $hook = $factory
    ->getEventHook();
  $this->hookToFactoryMap[$hook] = $factory;
}