function ldap_user_user_insert in Lightweight Directory Access Protocol (LDAP) 8.4
Same name and namespace in other branches
- 8.2 ldap_user/ldap_user.module \ldap_user_user_insert()
- 8.3 ldap_user/ldap_user.module \ldap_user_user_insert()
- 7.2 ldap_user/ldap_user.module \ldap_user_user_insert()
Implements hook_ENTITY_TYPE_insert().
File
- ldap_user/
ldap_user.module, line 102
Code
function ldap_user_user_insert($account) {
$event = new LdapNewUserCreatedEvent($account);
/** @var \Symfony\Component\EventDispatcher\EventDispatcher $dispatcher */
$dispatcher = \Drupal::service('event_dispatcher');
if (version_compare(\Drupal::VERSION, '9.1', '>=')) {
$dispatcher
->dispatch($event, LdapNewUserCreatedEvent::EVENT_NAME);
}
else {
$dispatcher
->dispatch(LdapNewUserCreatedEvent::EVENT_NAME, $event);
}
}