You are here

function core_event_dispatcher_entity_view in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/core_event_dispatcher/core_event_dispatcher.module \core_event_dispatcher_entity_view()

Implements hook_entity_view().

1 call to core_event_dispatcher_entity_view()
EntityViewEventTest::testEntityViewEventByReference in modules/core_event_dispatcher/tests/src/Unit/Entity/EntityViewEventTest.php
Test EntityViewEvent by reference.

File

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

Code

function core_event_dispatcher_entity_view(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, string $viewMode) {

  /** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
  $manager = Drupal::service('hook_event_dispatcher.manager');
  $manager
    ->register(new EntityViewEvent($build, $entity, $display, $viewMode));
}