You are here

function core_event_dispatcher_entity_operation in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/core_event_dispatcher/core_event_dispatcher.module \core_event_dispatcher_entity_operation()

Implements hook_entity_operation().

1 call to core_event_dispatcher_entity_operation()
EntityOperationsTest::testEntityOperation in modules/core_event_dispatcher/tests/src/Unit/Entity/EntityOperationsTest.php
EntityOperationEvent test.

File

modules/core_event_dispatcher/core_event_dispatcher.module, line 376
Core event dispatcher submodule.

Code

function core_event_dispatcher_entity_operation(EntityInterface $entity) {

  /** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
  $manager = Drupal::service('hook_event_dispatcher.manager');
  $event = new EntityOperationEvent($entity);
  $manager
    ->register($event);
  return $event
    ->getOperations();
}