You are here

static function NodeHierarchyEventSubscriber::getSubscribedEvents in Entity Reference Hierarchy 8

Implements EventSubscriberInterface::getSubscribedEvents().

Return value

array An array of event listener definitions.

File

src/EventSubscriber/NodeHierarchyEventSubscriber.php, line 69
Contains \Drupal\entity_hierarchy\EventSubscriber\NodeHierarchyEventSubscriber.

Class

NodeHierarchyEventSubscriber

Namespace

Drupal\entity_hierarchy\EventSubscriber

Code

static function getSubscribedEvents() {

  // Set a low value to start as early as possible.
  $events[KernelEvents::REQUEST][] = array(
    'onRequest',
    -100,
  );

  // Why only large positive value works here?
  $events[KernelEvents::RESPONSE][] = array(
    'onResponse',
    1000,
  );
  return $events;
}