You are here

public static function JsonapiBatchHelper::importEntityListBatchBatchFinished in Entity Share 8.2

Same name and namespace in other branches
  1. 8 modules/entity_share_client/src/JsonapiBatchHelper.php \Drupal\entity_share_client\JsonapiBatchHelper::importEntityListBatchBatchFinished()

Batch finish callback.

Parameters

bool $success: A boolean indicating whether the batch has completed successfully.

array $results: The value set in $context['results'] by callback_batch_operation().

array $operations: If $success is FALSE, contains the operations that remained unprocessed.

File

modules/entity_share_client/src/JsonapiBatchHelper.php, line 60

Class

JsonapiBatchHelper
Class JsonapiBatchHelper.

Namespace

Drupal\entity_share_client

Code

public static function importEntityListBatchBatchFinished($success, array $results, array $operations) {
  if ($success) {
    $message = new PluralTranslatableMarkup(count($results), 'One entity processed.', '@count entities processed.');
    \Drupal::messenger()
      ->addStatus($message);
  }
  else {
    $message = t('Finished with an error.');
    \Drupal::messenger()
      ->addError($message);
  }
}