You are here

public static function ContentHubImportQueueByFilter::batchFinished in Acquia Content Hub 8.2

Batch finish callback.

This will inspect the results of the batch and will display a message to indicate how the batch process ended.

Parameters

bool $success: The result of batch process.

array $result: The result of $context.

array $operations: The operations that were run.

File

modules/acquia_contenthub_subscriber/src/ContentHubImportQueueByFilter.php, line 103

Class

ContentHubImportQueueByFilter
Implements an Import Queue for entites based on custom filters.

Namespace

Drupal\acquia_contenthub_subscriber

Code

public static function batchFinished($success, array $result, array $operations) {
  if ($success) {
    \Drupal::messenger()
      ->addMessage('Processed cloud filters.');
    return;
  }
  $error_operation = reset($operations);
  \Drupal::messenger()
    ->addMessage(t('An error occurred while processing @operation with arguments : @args', [
    '@operation' => $error_operation[0],
    '@args' => print_r($error_operation[0], TRUE),
  ]));
}