You are here

class EntityLegalSubscriber in Entity Legal 4.0.x

Same name and namespace in other branches
  1. 8.2 src/EventSubscriber/EntityLegalSubscriber.php \Drupal\entity_legal\EventSubscriber\EntityLegalSubscriber
  2. 3.0.x src/EventSubscriber/EntityLegalSubscriber.php \Drupal\entity_legal\EventSubscriber\EntityLegalSubscriber

Class EntityLegalSubscriber.

@package Drupal\entity_legal\EventSubscriber

Hierarchy

  • class \Drupal\entity_legal\EventSubscriber\EntityLegalSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of EntityLegalSubscriber

1 string reference to 'EntityLegalSubscriber'
entity_legal.services.yml in ./entity_legal.services.yml
entity_legal.services.yml
1 service uses EntityLegalSubscriber
entity_legal.subscriber in ./entity_legal.services.yml
Drupal\entity_legal\EventSubscriber\EntityLegalSubscriber

File

src/EventSubscriber/EntityLegalSubscriber.php, line 14

Namespace

Drupal\entity_legal\EventSubscriber
View source
class EntityLegalSubscriber implements EventSubscriberInterface {

  /**
   * Request event callback.
   *
   * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
   *   The request event.
   */
  public function checkRedirect(GetResponseEvent $event) {
    $context = [
      'event' => $event,
    ];

    // Execute Redirect method plugin.
    \Drupal::service('plugin.manager.entity_legal')
      ->createInstance('redirect')
      ->execute($context);
  }

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    $events[KernelEvents::REQUEST][] = [
      'checkRedirect',
    ];
    return $events;
  }

}

Members