You are here

public static function BatchExportProcessor::processBatchOperation in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Processors/BatchExportProcessor.php \Drupal\content_synchronizer\Processors\BatchExportProcessor::processBatchOperation()
  2. 3.x src/Processors/BatchExportProcessor.php \Drupal\content_synchronizer\Processors\BatchExportProcessor::processBatchOperation()

Do a batch operation.

Parameters

array $entityData: Entity data.

array $context: Context.

Overrides BatchProcessorBase::processBatchOperation

File

src/Processors/BatchExportProcessor.php, line 84

Class

BatchExportProcessor
BatchExport processor.

Namespace

Drupal\content_synchronizer\Processors

Code

public static function processBatchOperation(array $entityData, array $context) {

  /** @var ExportEntityWriter $writer */
  $writer = $entityData['writer'];

  // Get the entity :

  /** @var \Drupal\Core\Entity\Entity $entity */
  if ($entity = \Drupal::entityTypeManager()
    ->getStorage($entityData['entity_type'])
    ->load($entityData['entity_id'])) {

    /** @var ExportProcessor $processor */
    $processor = new ExportProcessor($writer);
    $processor
      ->exportEntity($entity);
  }
  $context['results']['writer'] = $writer;
  $context['results']['finishCallback'] = $entityData['finishCallback'];
}