You are here

private function OrphanProcessor::cancelUser in Lightweight Directory Access Protocol (LDAP) 8.4

Cancel the user.

Parameters

\Drupal\user\UserInterface $account: Account.

string $method: Method.

1 call to OrphanProcessor::cancelUser()
OrphanProcessor::processOrphanedAccounts in ldap_user/src/Processor/OrphanProcessor.php
Process one user.

File

ldap_user/src/Processor/OrphanProcessor.php, line 361

Class

OrphanProcessor
Locates potential orphan user accounts.

Namespace

Drupal\ldap_user\Processor

Code

private function cancelUser(UserInterface $account, string $method) : void {

  // Copied from user_canel().
  // When the 'user_cancel_delete' method is used, user_delete() is called,
  // which invokes hook_ENTITY_TYPE_predelete() and hook_ENTITY_TYPE_delete()
  // for the user entity. Modules should use those hooks to respond to the
  // account deletion.
  $edit = [];
  if ($method !== 'user_cancel_delete') {
    \Drupal::moduleHandler()
      ->invokeAll('user_cancel', [
      $edit,
      $account,
      $method,
    ]);
  }
  _user_cancel($edit, $account, $method);
}