Results
24.04.2024
billwerk_subscriptions 1.x-dev ::
modules/billwerk_subscriptions_handler_default/src/EventSubscriber/SubscriberContractChangedEventSubscriber.php
case 'delete':
// @improve: Better use user_cancel() here to respect the \Drupal::config('user.settings')->get('cancel_method');.
// As this includes batch etc. for now we decided against this for
// bad DX reasons.
$subscriber->getUser()->delete();
$this->logHelper->info(
'Deleted user #@uid because the contract was canceled at Billwerk and user deletion is configured as reaction in billwerk_subscriptions_handler_default.',
[ 24.04.2024
billwerk_subscriptions 1.x-dev ::
modules/billwerk_subscriptions_handler_default/src/EventSubscriber/BillwerkWebhookEventSubscriber.php
case 'delete':
// @improve: Better use user_cancel() here to respect the \Drupal::config('user.settings')->get('cancel_method');.
// As this includes batch etc. for now we decided against this for
// bad DX reasons.
$subscriber->getUser()->delete();
$this->logHelper->info(
'Deleted user #@uid because the contract was deleted at Billwerk and user deletion is configured as reaction in billwerk_subscriptions_handler_default.',
[
case 'delete':
// @improve: Better use user_cancel() here to respect the \Drupal::config('user.settings')->get('cancel_method');.
// As this includes batch etc. for now we decided against this for
// bad DX reasons.
$subscriber->getUser()->delete();
$this->logHelper->info(
'Deleted user #@uid because the customer was deleted at Billwerk and user deletion is configured as reaction in billwerk_subscriptions_handler_default.',
[ 04.03.2020
block_inactive_users 8.x-1.4 ::
src/InactiveUsersHandler.php
*/
public function cancelUser($uid, $block_inactive_users_cancel_email, $disable_account_method) {
user_cancel(
[
'user_cancel_notify' => $block_inactive_users_cancel_email,
'user_cancel_method' => $disable_account_method,
], $uid, $disable_account_method
);
} 15.10.2023
bm 1.0.x-dev ::
bm.module
/**
* Implements hook_user_cancel().
*/
function bm_user_cancel($edit, UserInterface $account, $method): void {
switch ($method) {
case 'user_cancel_block_unpublish':
// Unpublish booking managers.
$storage = \Drupal::entityTypeManager()->getStorage('bm');
$bm_ids = $storage->getQuery()
->condition('uid', $account->id()) 03.10.2020
braintree_cashier 8.x-4.x-dev ::
braintree_cashier.module
/**
* Implements hook_user_cancel().
*/
function braintree_cashier_user_cancel($edit, UserInterface $account, $method) {
/** @var \Drupal\braintree_cashier\BillableUser $billable_user_service */
$billable_user_service = \Drupal::service('braintree_cashier.billable_user');
/** @var \Drupal\braintree_cashier\SubscriptionService $subscription_serivce */
$subscription_serivce = \Drupal::service('braintree_cashier.subscription_service');
$subscriptions = $billable_user_service->getSubscriptions($account); 01.03.2023
bulkbatchdelete 8.x-1.2 ::
src/Service/BatchService.php
public static function deleteUserEntity($userId, string $use_cancellation_method)
{
user_cancel([], $userId, $use_cancellation_method);
$account = User::load($userId);
$deleteAccountConfirmation = $account->delete();
return $deleteAccountConfirmation;
}
/** 06.07.2020
cancel_account 8.x-1.1 ::
src/Form/CancelAccountForm.php
// Cancel user account finally.
user_cancel($edit, $this->currentUser()->id(), $method);
// Redirect user to the front page.
$form_state->setRedirect('<front>');
}
} 19.06.2020
cas_mock_server 8.x-1.0 ::
tests/src/Context/CasMockServerContext.php
if (!empty($users)) {
foreach ($users as $user) {
user_cancel([], $user->id(), 'user_cancel_delete');
}
$this->getDriver()->processBatch();
}
$this->users = [];
} 26.05.2020
certificate 4.0.0-alpha1 ::
certificate.module
/**
* Implements hook_user_cancel().
*
* Delete the user's certificate snapshots.
*/
function certificate_user_delete($account) {
$csids = \Drupal::entityQuery('certificate_snapshot')
->condition('uid', $account->id()) 24.09.2024
commands 1.x-dev ::
modules/tasks/tasks.module
/**
* Implements hook_user_cancel().
*/
function tasks_user_cancel($edit, UserInterface $account, $method): void {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize taskss.
$storage = \Drupal::entityTypeManager()->getStorage('task');
$task_ids = $storage->getQuery()
->condition('uid', $account->id()) 24.09.2024
commands 1.x-dev ::
commands.module
/**
* Implements hook_user_cancel().
*/
function command_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize commands.
$storage = \Drupal::entityTypeManager()->getStorage('command');
$command_ids = $storage->getQuery()
->condition('uid', $account->id()) 10.07.2020
comment_notify 8.x-1.x-dev ::
tests/src/Functional/CommentNotifyUserPreferencesTest.php
$user = $this->drupalCreateUser($this->permissions);
$this->container->get('comment_notify.user_settings')->saveSettings($user->id(), COMMENT_NOTIFY_ENTITY, COMMENT_NOTIFY_COMMENT);
user_cancel([], $user->id(), $cancel_method_option);
$this->assertTrue(is_null($this->container->get('comment_notify.user_settings')->getSettings($user->id())));
}
// Delete Account.
$user = $this->drupalCreateUser($this->permissions);
$this->container->get('comment_notify.user_settings')->saveSettings($user->id(), COMMENT_NOTIFY_ENTITY, COMMENT_NOTIFY_COMMENT); 10.07.2020
comment_notify 8.x-1.x-dev ::
comment_notify.module
/**
* Implements hook_user_cancel().
*/
function comment_notify_user_cancel($edit, $account, $method) {
// This hook is invoked when the account is disabled.
comment_notify_remove_user_settings($account->id());
}
/**
* Remove the user settings of of the user with the given $uid. 05.09.2023
commerce_alphabank_redirect 1.0.1 ::
commerce_alphabank_redirect.pages.inc
if ($payment_status == 'CANCELED') {
commerce_static_checkout_url_redirect_with_cancel('alphabank', $order);
}
else {
commerce_static_checkout_url_redirect_with_error('alphabank', $order, $error_message);
}
} 25.06.2021
commerce_cart_skip 1.0.x-dev ::
commerce_cart_skip.module
function commerce_cart_skip_cancel(array $form, FormStateInterface $form_state) {
$rule = $form_state->get('skip_rule');
$selectedVariation = commerce_cart_skip_get_variation($form, $form_state);
$order = commerce_cart_skip_get_order($form, $form_state);
if ($order->getState()->isTransitionAllowed('cancel')) {
$order->getState()->applyTransitionById('cancel');
$order->save(); 29.06.2020
commerce_funds 8.x-1.7 ::
commerce_funds.module
/**
* Implements hook_user_cancel().
*/
function commerce_funds_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_reassign':
// Anonymize transactions where user is issuer.
$storage = \Drupal::entityTypeManager()->getStorage('commerce_funds_transaction');
$transaction_ids = $storage->getQuery()
->accessCheck(FALSE) 03.08.2020
commerce_gc_client 8.x-1.9 ::
src/Form/MandateCancel.php
)->save();
}
commerce_gc_client_mandate_cancel($this->order->id());
$url = $this->getCancelUrl();
$form_state->setRedirect($url->getRouteName(), $url->getRouteParameters());
}
} 03.08.2020
commerce_gc_client 8.x-1.9 ::
commerce_gc_client.module
* database using the Commerce order ID.
*/
function commerce_gc_client_mandate_cancel($order_id, $mandate = NULL) {
$db = \Drupal::database();
if ($mandate) {
$mandates[$mandate->gcid] = $mandate;
}
else {
$mandates = $db->select('commerce_gc_client', 'c')
// Cancel GoCardless mandate first before deleting the order.
if ($mandate->gc_mandate_status !== 'cancelled') {
commerce_gc_client_mandate_cancel($order->id(), $mandate);
}
foreach ($order->getItems() as $item) {
$db->delete('commerce_gc_client_item_schedule')->condition('item_id', $item->id())->execute();
$db->delete('commerce_gc_client_item')->condition('item_id', $item->id())->execute();
} 05.06.2020
content_lock 8.x-2.1 ::
src/Hook/ContentLockHooks.php
/**
* Implements hook_user_cancel().
*/
#[Hook('user_cancel')]
public function userCancel($edit, UserInterface $account, $method): void {
$this->contentLock->releaseAllUserLocks((int) $account->id());
} 05.06.2020
content_lock 8.x-2.1 ::
content_lock.module
/**
* Implements hook_user_cancel().
*/
#[LegacyHook]
function content_lock_user_cancel($edit, UserInterface $account, $method) {
\Drupal::service(ContentLockHooks::class)->userCancel($edit, $account, $method);
}
/**
* Implements hook_module_implements_alter().
*/ 