You are here

public static function BulkCloneNode::batchFinished in Entity Bulk Clone 8

File

src/Plugin/Action/BulkCloneNode.php, line 42

Class

BulkCloneNode
Entity Bulk clone of nodes.

Namespace

Drupal\entity_bulk_clone\Plugin\Action

Code

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

  // The 'success' parameter means no fatal PHP errors were detected.
  if ($success) {
    $message = \Drupal::translation()
      ->formatPlural(count($results), 'Bulk Clone was applied to ', '@count items.');
    \Drupal::messenger()
      ->addStatus($message);
  }
  else {
    $message = $this
      ->t('Finished with an error.');
    \Drupal::messenger()
      ->addError($message);
  }
}