You are here

function ldap_user_user_update in Lightweight Directory Access Protocol (LDAP) 8.4

Same name and namespace in other branches
  1. 8.2 ldap_user/ldap_user.module \ldap_user_user_update()
  2. 8.3 ldap_user/ldap_user.module \ldap_user_user_update()
  3. 7.2 ldap_user/ldap_user.module \ldap_user_user_update()

Implements hook_ENTITY_TYPE_update().

File

ldap_user/ldap_user.module, line 133

Code

function ldap_user_user_update($account) {
  $event = new LdapUserUpdatedEvent($account);

  /** @var \Symfony\Component\EventDispatcher\EventDispatcher $dispatcher */
  $dispatcher = \Drupal::service('event_dispatcher');
  if (version_compare(\Drupal::VERSION, '9.1', '>=')) {
    $dispatcher
      ->dispatch($event, LdapUserUpdatedEvent::EVENT_NAME);
  }
  else {
    $dispatcher
      ->dispatch(LdapUserUpdatedEvent::EVENT_NAME, $event);
  }
}