You are here

class EventListener in Facets 8

Class EventListener.

Hierarchy

  • class \Drupal\facets_events_test\EventListener implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of EventListener

1 string reference to 'EventListener'
facets_events_test.services.yml in tests/facets_events_test/facets_events_test.services.yml
tests/facets_events_test/facets_events_test.services.yml
1 service uses EventListener
facets_events_test.event_listener in tests/facets_events_test/facets_events_test.services.yml
Drupal\facets_events_test\EventListener

File

tests/facets_events_test/src/EventListener.php, line 11

Namespace

Drupal\facets_events_test
View source
class EventListener implements EventSubscriberInterface {

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    return [
      QueryStringCreated::NAME => 'queryStringCreated',
    ];
  }

  /**
   * Event handler for the query string created event.
   *
   * @param \Drupal\facets\Event\QueryStringCreated $event
   *   The query string created event.
   */
  public function queryStringCreated(QueryStringCreated $event) {
    $event
      ->getQueryParameters()
      ->add([
      'test' => 'fun',
    ]);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EventListener::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to.
EventListener::queryStringCreated public function Event handler for the query string created event.