You are here

protected function BatchExportProcessor::getBatchOperations in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Processors/BatchExportProcessor.php \Drupal\content_synchronizer\Processors\BatchExportProcessor::getBatchOperations()
  2. 3.x src/Processors/BatchExportProcessor.php \Drupal\content_synchronizer\Processors\BatchExportProcessor::getBatchOperations()
1 call to BatchExportProcessor::getBatchOperations()
BatchExportProcessor::exportEntities in src/Processors/BatchExportProcessor.php
Export entities.

File

src/Processors/BatchExportProcessor.php, line 56

Class

BatchExportProcessor
BatchExport processor.

Namespace

Drupal\content_synchronizer\Processors

Code

protected function getBatchOperations(array $entities, $finishCallback = NULL) {
  $operations = [];

  /** @var \Drupal\Core\Entity\Entity $entity */
  foreach ($entities as $entity) {
    $operations[] = [
      get_called_class() . '::processBatchOperation',
      [
        [
          'entity_id' => $entity
            ->id(),
          'entity_type' => $entity
            ->getEntityTypeId(),
          'writer' => $this->writer,
          'finishCallback' => $finishCallback,
        ],
      ],
    ];
  }
  return $operations;
}