You are here

public function PreprocessEventFactoryMapper::getFactory in Hook Event Dispatcher 3.x

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

Get a factory with the provided hook or the default factory.

Parameters

string $hook: The hook name.

Return value

\Drupal\preprocess_event_dispatcher\Factory\PreprocessEventFactoryInterface|null PreprocessEventFactory.

File

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

Class

PreprocessEventFactoryMapper
Class PreprocessEventFactoryMapper.

Namespace

Drupal\preprocess_event_dispatcher\Service

Code

public function getFactory(string $hook) : ?PreprocessEventFactoryInterface {
  return $this->hookToFactoryMap[$hook] ?? NULL;
}