You are here

public static function PushEntities::batchFinished in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 src/Controller/PushEntities.php \Drupal\cms_content_sync\Controller\PushEntities::batchFinished()
  2. 2.1.x src/Controller/PushEntities.php \Drupal\cms_content_sync\Controller\PushEntities::batchFinished()

Batch push finished callback.

Parameters

$success:

$results:

$operations:

File

src/Controller/PushEntities.php, line 268

Class

PushEntities
Pull controller.

Namespace

Drupal\cms_content_sync\Controller

Code

public static function batchFinished($success, $results, $operations) {
  $succeeded = count(array_filter($results));
  \Drupal::messenger()
    ->addMessage(t('%synchronized items have been pushed to your @repository.', [
    '@repository' => _cms_content_sync_get_repository_name(),
    '%synchronized' => $succeeded,
  ]));
  $failed = count($results) - $succeeded;
  if ($failed) {
    \Drupal::messenger()
      ->addMessage(t('%synchronized items have not been pushed to your @repository.', [
      '@repository' => _cms_content_sync_get_repository_name(),
      '%synchronized' => $failed,
    ]));
  }
}