You are here

function hook_event_dispatcher_entity_view in Hook Event Dispatcher 8

Implements hook_entity_view().

2 calls to hook_event_dispatcher_entity_view()
EntityViewEventTest::testEntityViewEventByReference in tests/src/Unit/Entity/EntityViewEventTest.php
Test EntityViewEvent by reference.
EntityViewEventTest::testEntityViewEventBySet in tests/src/Unit/Entity/EntityViewEventTest.php
Test EntityViewEvent by set.

File

./hook_event_dispatcher.module, line 218
Hook event dispatcher module.

Code

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

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