class EntityLegalSubscriber in Entity Legal 4.0.x
Same name and namespace in other branches
- 8.2 src/EventSubscriber/EntityLegalSubscriber.php \Drupal\entity_legal\EventSubscriber\EntityLegalSubscriber
- 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'
1 service uses EntityLegalSubscriber
File
- src/
EventSubscriber/ EntityLegalSubscriber.php, line 14
Namespace
Drupal\entity_legal\EventSubscriberView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityLegalSubscriber:: |
public | function | Request event callback. | |
EntityLegalSubscriber:: |
public static | function |