You are here

public static function ConvertBundles::convertBundlesFinishedCallback in Convert Bundles 8

File

src/ConvertBundles.php, line 313

Class

ConvertBundles
ConvertBundles.

Namespace

Drupal\convert_bundles

Code

public static function convertBundlesFinishedCallback($success, $results, $operations) {

  // The 'success' parameter means no fatal PHP errors were detected. All
  // other error management should be handled using 'results'.
  if ($success) {
    $message = \Drupal::translation()
      ->formatPlural(count($results), 'One operation processed.', '@count operations processed.');
  }
  else {
    $message = t('Finished with an error.');
  }
  \Drupal::messenger()
    ->addStatus($message);
}