You are here

final class Psr14Bridge in Search API Solr 4.x

Same name and namespace in other branches
  1. 8 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
SearchApiSolrBackend.php in src/Plugin/search_api/backend/SearchApiSolrBackend.php

File

src/Solarium/EventDispatcher/Psr14Bridge.php, line 12

Namespace

Drupal\search_api_solr\Solarium\EventDispatcher
View source
final class Psr14Bridge extends ContainerAwareEventDispatcher implements EventDispatcherInterface {

  /**
   * @var \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher
   */
  protected $dispatcher;
  public function __construct(ContainerAwareEventDispatcher $eventDispatcher) {
    $this->dispatcher = $eventDispatcher;
  }
  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

Namesort descending Modifiers Type Description Overrides
ContainerAwareEventDispatcher::$container protected property The service container.
ContainerAwareEventDispatcher::$listeners protected property Listener definitions.
ContainerAwareEventDispatcher::$unsorted protected property Whether listeners need to be sorted prior to dispatch, keyed by event name.
ContainerAwareEventDispatcher::addSubscriber public function
ContainerAwareEventDispatcher::getListenerPriority public function
ContainerAwareEventDispatcher::getListeners public function
ContainerAwareEventDispatcher::hasListeners public function
ContainerAwareEventDispatcher::removeListener public function
ContainerAwareEventDispatcher::removeSubscriber public function
Psr14Bridge::$dispatcher protected property
Psr14Bridge::addListener public function Overrides ContainerAwareEventDispatcher::addListener
Psr14Bridge::dispatch public function Overrides ContainerAwareEventDispatcher::dispatch
Psr14Bridge::__construct public function Constructs a container aware event dispatcher. Overrides ContainerAwareEventDispatcher::__construct