function purge_users_batch_completed in Auto Purge Users 8
Same name and namespace in other branches
- 8.3 purge_users.module \purge_users_batch_completed()
- 8.2 purge_users.module \purge_users_batch_completed()
- 7.2 purge_users.module \purge_users_batch_completed()
- 7 purge_users.module \purge_users_batch_completed()
The batch finish handler.
1 string reference to 'purge_users_batch_completed'
- ConfirmationForm::submitForm in src/
Form/ ConfirmationForm.php - Form submission handler.
File
- ./
purge_users.module, line 170 - Purge users module file.
Code
function purge_users_batch_completed($success, $results, $operations) {
if ($success) {
$purged = isset($results['purged']) ? $results['purged'] : 0;
$message = t('@count Users has been purged.', array(
'@count' => $purged,
));
drupal_set_message($message);
}
else {
$error_operation = reset($operations);
$message = t('An error occurred while processing %error_operation with arguments: @arguments', array(
'%error_operation' => $error_operation[0],
'@arguments' => print_r($error_operation[1], TRUE),
));
drupal_set_message($message, 'error');
}
return new RedirectResponse(Url::fromRoute('purge_users.settings')
->toString());
}