You are here

function hook_event_dispatcher_user_format_name_alter in Hook Event Dispatcher 8

Implements hook_user_format_name_alter().

2 calls to hook_event_dispatcher_user_format_name_alter()
UserEventTest::testUserFormatNameAlterEventByReference in tests/src/Unit/User/UserEventTest.php
User format name alter event by reference test.
UserEventTest::testUserFormatNameAlterEventWithSet in tests/src/Unit/User/UserEventTest.php
User format name alter event with set test.

File

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

Code

function hook_event_dispatcher_user_format_name_alter(&$name, AccountInterface $account) {

  /** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
  $manager = \Drupal::service('hook_event_dispatcher.manager');
  $event = new UserFormatNameAlterEvent($name, $account);
  $manager
    ->register($event);
}