You are here

public function SiteSettingsReplicator::finishBatch in Site Settings and Labels 8

Finish callback for the batch replicate form.

Parameters

bool $success: Whether the batch was successful or not.

array $results: The bath results.

array $operations: The batch operations.

File

src/SiteSettingsReplicator.php, line 234

Class

SiteSettingsReplicator
Class SiteSettingsReplicator.

Namespace

Drupal\site_settings

Code

public function finishBatch($success, array $results, array $operations) {
  if (!$success) {
    $message = $this
      ->t('The settings creation was unsuccessful for an unknown reason. Please check your error logs.');
    $messenger = \Drupal::messenger();
    $messenger
      ->addWarning($message);
  }

  // Redirect back to manage site settings page.
  $url = Url::fromRoute('entity.site_setting_entity_type.collection');
  $url_string = $url
    ->toString();
  $response = new RedirectResponse($url_string);
  $response
    ->send();
}