You are here

public function BulkUserImport::batchProcessUserInfo in Bulk User Registration 8

Process user information in a batch.

Parameters

array $userData: Structured array of user data.

string $defaultRole: Default user role.

1 call to BulkUserImport::batchProcessUserInfo()
BulkUserImport::handleFileData in src/Form/BulkUserImport.php
To import data as users.

File

src/Form/BulkUserImport.php, line 187

Class

BulkUserImport
Bulk user import form.

Namespace

Drupal\bulk_user_registration\Form

Code

public function batchProcessUserInfo(array $userData, $defaultRole) {
  $operations = [];
  foreach ($userData as $data) {
    $operations[] = [
      '\\Drupal\\bulk_user_registration\\Form\\BulkUserImport::batchImport',
      [
        'userData' => $data,
        'defaultRole' => $defaultRole,
      ],
    ];
  }
  $batch = [
    'title' => $this
      ->t('Importing users..'),
    'operations' => $operations,
    'finished' => '\\Drupal\\bulk_user_registration\\Form\\BulkUserImport::batchFinished',
  ];
  batch_set($batch);
}