You are here

public function PreprocessEventFactoryMapper::addFactory in Hook Event Dispatcher 8

Add Factory to the mapper.

Parameters

\Drupal\hook_event_dispatcher\Event\Preprocess\Factory\PreprocessEventFactoryInterface $factory: Provided factory to add.

File

src/Service/PreprocessEventFactoryMapper.php, line 25

Class

PreprocessEventFactoryMapper
Class PreprocessEventFactoryMapper.

Namespace

Drupal\hook_event_dispatcher\Service

Code

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