You are here

public static function RefreshBatch::finished in Media Thumbnails 8

Batch finish callback.

File

src/Batch/RefreshBatch.php, line 84

Class

RefreshBatch
Class RefreshBatch.

Namespace

Drupal\media_thumbnails\Batch

Code

public static function finished($success, $results, $operations) {
  $variables = [
    '@processed' => $results['processed'],
  ];
  if ($success) {
    Drupal::messenger()
      ->addMessage(t('Processed @processed media entities.', $variables));
  }
  else {
    Drupal::messenger()
      ->addWarning(t('An error occurred after processing @processed media entities.', $variables));
  }
}