You are here

public function UserDeleteController::getUserDeleteBatch in Delete all 8

Same name and namespace in other branches
  1. 2.x src/Controller/UserDeleteController.php \Drupal\delete_all\Controller\UserDeleteController::getUserDeleteBatch()

File

src/Controller/UserDeleteController.php, line 52

Class

UserDeleteController
Returns responses for devel module routes.

Namespace

Drupal\delete_all\Controller

Code

public function getUserDeleteBatch($users_to_delete = FALSE) {

  // Define batch.
  $batch = [
    'operations' => [
      [
        'delete_all_users_batch_delete',
        [
          $users_to_delete,
        ],
      ],
    ],
    'finished' => 'delete_all_users_batch_delete_finished',
    'title' => $this
      ->t('Deleting users'),
    'init_message' => $this
      ->t('User deletion is starting.'),
    'progress_message' => $this
      ->t('Deleting users...'),
    'error_message' => $this
      ->t('User deletion has encountered an error.'),
  ];
  return $batch;
}