final class Psr14Bridge in Search API Solr 8
Same name and namespace in other branches
- 4.x src/Solarium/EventDispatcher/Psr14Bridge.php \Drupal\search_api_solr\Solarium\EventDispatcher\Psr14Bridge
A helper to decorate the legacy EventDispatcherInterface::dispatch().
Hierarchy
- class \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher implements \Symfony\Component\EventDispatcher\EventDispatcherInterface
- class \Drupal\search_api_solr\Solarium\EventDispatcher\Psr14Bridge implements \Psr\EventDispatcher\EventDispatcherInterface
Expanded class hierarchy of Psr14Bridge
1 file declares its use of Psr14Bridge
- SolrConnectorPluginBase.php in src/
SolrConnector/ SolrConnectorPluginBase.php
File
- src/
Solarium/ EventDispatcher/ Psr14Bridge.php, line 12
Namespace
Drupal\search_api_solr\Solarium\EventDispatcherView source
final class Psr14Bridge extends ContainerAwareEventDispatcher implements EventDispatcherInterface {
/**
* @var \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher
*/
protected $dispatcher;
public function __construct() {
$this->dispatcher = \Drupal::service('event_dispatcher');
}
public function dispatch($event, Event $null = NULL) {
if (\is_object($event)) {
return $this->dispatcher
->dispatch(\get_class($event), new EventProxy($event));
}
return $this->dispatcher
->dispatch($event, $null);
}
public function addListener($event_name, $listener, $priority = 0) {
$this->dispatcher
->addListener($event_name, $listener, $priority);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContainerAwareEventDispatcher:: |
protected | property | The service container. | |
ContainerAwareEventDispatcher:: |
protected | property | Listener definitions. | |
ContainerAwareEventDispatcher:: |
protected | property | Whether listeners need to be sorted prior to dispatch, keyed by event name. | |
ContainerAwareEventDispatcher:: |
public | function | Adds an event subscriber. | |
ContainerAwareEventDispatcher:: |
public | function | ||
ContainerAwareEventDispatcher:: |
public | function | Gets the listeners of a specific event or all listeners sorted by descending priority. | |
ContainerAwareEventDispatcher:: |
public | function | Checks whether an event has any registered listeners. | |
ContainerAwareEventDispatcher:: |
public | function | Removes an event listener from the specified events. | |
ContainerAwareEventDispatcher:: |
public | function | Removes an event subscriber. | |
Psr14Bridge:: |
protected | property | ||
Psr14Bridge:: |
public | function |
Adds an event listener that listens on the specified events. Overrides ContainerAwareEventDispatcher:: |
|
Psr14Bridge:: |
public | function |
Dispatches an event to all registered listeners. Overrides ContainerAwareEventDispatcher:: |
|
Psr14Bridge:: |
public | function |
Constructs a container aware event dispatcher. Overrides ContainerAwareEventDispatcher:: |