You are here

function _entity_events_dispatch in Entity Events 2.0.x

Same name and namespace in other branches
  1. 8 entity_events.module \_entity_events_dispatch()

Helper method to dispatch an event.

Parameters

string $event_type: The event type.

\Drupal\Component\EventDispatcher\Event $event: The event to dispatch.

4 calls to _entity_events_dispatch()
entity_events_entity_delete in ./entity_events.module
Implements hook_entity_delete().
entity_events_entity_insert in ./entity_events.module
Implements hook_entity_insert().
entity_events_entity_presave in ./entity_events.module
Implements hook_entity_presave().
entity_events_entity_update in ./entity_events.module
Implements hook_entity_update().

File

./entity_events.module, line 65
This module holds functions for entity events.

Code

function _entity_events_dispatch($event_type, Event $event) {

  /** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher */
  $dispatcher = \Drupal::service('event_dispatcher');
  $dispatcher
    ->dispatch($event, $event_type);
}