You are here

public static function ContentSync::processBatch in Content Synchronization 8

Processes the config import batch and persists the importer.

Parameters

\Drupal\Core\Config\ConfigImporter $config_importer: The batch config importer object to persist.

string $sync_step: The synchronization step to do.

array $context: The batch context.

File

src/Form/ContentSync.php, line 355

Class

ContentSync
Construct the storage changes in a content synchronization form.

Namespace

Drupal\content_sync\Form

Code

public static function processBatch(ConfigImporter $config_importer, $sync_step, &$context) {
  if (!isset($context['sandbox']['config_importer'])) {
    $context['sandbox']['config_importer'] = $config_importer;
  }
  $config_importer = $context['sandbox']['config_importer'];
  $config_importer
    ->doSyncStep($sync_step, $context);
  if ($errors = $config_importer
    ->getErrors()) {
    if (!isset($context['results']['errors'])) {
      $context['results']['errors'] = [];
    }
    $context['results']['errors'] += $errors;
  }
}