You are here

public static function ExampleEntityEventSubscribers::getSubscribedEvents in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 examples/ExampleEntityEventSubscribers.php \Drupal\hook_event_dispatcher\ExampleEntityEventSubscribers::getSubscribedEvents()

File

examples/ExampleEntityEventSubscribers.php, line 108

Class

ExampleEntityEventSubscribers
Class ExampleEntityEventSubscribers.

Namespace

Drupal\hook_event_dispatcher

Code

public static function getSubscribedEvents() : array {
  return [
    HookEventDispatcherInterface::ENTITY_VIEW => 'alterEntityView',
    HookEventDispatcherInterface::ENTITY_PRE_SAVE => 'entityPreSave',
    HookEventDispatcherInterface::ENTITY_INSERT => 'entityInsert',
    HookEventDispatcherInterface::ENTITY_UPDATE => 'entityUpdate',
    HookEventDispatcherInterface::ENTITY_PRE_DELETE => 'entityPreDelete',
    HookEventDispatcherInterface::ENTITY_DELETE => 'entityDelete',
  ];
}