You are here

public static function BulkUserImport::batchFinished in Bulk User Registration 8

Batch callback: Finish bulk user import process.

Parameters

bool $success: Success or not.

array $results: Results array.

mixed $operations: Operations.

File

src/Form/BulkUserImport.php, line 250

Class

BulkUserImport
Bulk user import form.

Namespace

Drupal\bulk_user_registration\Form

Code

public static function batchFinished($success, array $results, $operations) {
  $messenger = \Drupal::messenger();
  if ($success) {
    $messenger
      ->addStatus(\Drupal::translation()
      ->formatPlural(count($results), '1 user imported.', '@count users imported.'));
  }
  else {
    $messenger
      ->addError(t('Finished with errors.'));
  }
}