You are here

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

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

Batch push finished callback.

Parameters

$success:

$results:

$operations:

Return value

\Symfony\Component\HttpFoundation\RedirectResponse

File

modules/cms_content_sync_health/src/Controller/VersionMismatches.php, line 73

Class

VersionMismatches
Show all version mismatches of all entity types. Can take some time to execute depending on the number of entity types configured, so is run as a batch operation.

Namespace

Drupal\cms_content_sync_health\Controller

Code

public static function batchFinished($success, $results, $operations) {
  $list = _cms_content_sync_display_entity_type_differences_recursively_render($results);
  if (empty($list)) {
    \Drupal::messenger()
      ->addStatus(\Drupal::translation()
      ->translate("No differences found; all other connected sites use the same entity type definition as this site."));
  }
  else {
    \Drupal::messenger()
      ->addError(\Drupal::translation()
      ->translate("Some connected sites use other entity type definitions than this site."));
    \Drupal::messenger()
      ->addError($list);
  }
  return RedirectResponse::create(Url::fromRoute('entity.cms_content_sync.sync_health')
    ->toString());
}