final class HookEventDispatcherManager in Hook Event Dispatcher 8
Same name and namespace in other branches
- 8.2 src/Manager/HookEventDispatcherManager.php \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManager
- 3.x src/Manager/HookEventDispatcherManager.php \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManager
Class HookEventDispatcherManager.
Wrapper class for the external dispatcher dependency. If this ever changes we only have to change it once.
Hierarchy
- class \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManager implements HookEventDispatcherManagerInterface
Expanded class hierarchy of HookEventDispatcherManager
1 file declares its use of HookEventDispatcherManager
- HookEventDispatcherManagerTest.php in tests/
src/ Unit/ Manager/ HookEventDispatcherManagerTest.php
1 string reference to 'HookEventDispatcherManager'
1 service uses HookEventDispatcherManager
File
- src/
Manager/ HookEventDispatcherManager.php, line 14
Namespace
Drupal\hook_event_dispatcher\ManagerView source
final class HookEventDispatcherManager implements HookEventDispatcherManagerInterface {
/**
* The event dispatcher.
*
* @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
*/
private $eventDispatcher;
/**
* EntityDispatcherManager constructor.
*
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher
* The event dispatcher.
*/
public function __construct(EventDispatcherInterface $eventDispatcher) {
$this->eventDispatcher = $eventDispatcher;
}
/**
* {@inheritdoc}
*/
public function register(EventInterface $event) {
return $this->eventDispatcher
->dispatch($event
->getDispatcherType(), $event);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HookEventDispatcherManager:: |
private | property | The event dispatcher. | |
HookEventDispatcherManager:: |
public | function |
Registers an event dispatcher for given entity. Overrides HookEventDispatcherManagerInterface:: |
|
HookEventDispatcherManager:: |
public | function | EntityDispatcherManager constructor. |