public function PreprocessEventFactoryMapper::getFactory in Hook Event Dispatcher 8
Get a factory with the provided hook or the default factory.
Parameters
string $hook: The hook name.
Return value
\Drupal\hook_event_dispatcher\Event\Preprocess\Factory\PreprocessEventFactoryInterface|null PreprocessEventFactory.
File
- src/
Service/ PreprocessEventFactoryMapper.php, line 39
Class
- PreprocessEventFactoryMapper
- Class PreprocessEventFactoryMapper.
Namespace
Drupal\hook_event_dispatcher\ServiceCode
public function getFactory($hook) {
if (isset($this->hookToFactoryMap[$hook])) {
return $this->hookToFactoryMap[$hook];
}
return NULL;
}