You are here

public function BatchImportProcessor::import in Content Synchronizer 8

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

Launch the import of the import entity.

Parameters

\Drupal\content_synchronizer\Entity\ImportEntity $import: The import entity.

array $entitiesToImport: The entities to import.

mixed $finishCallBack: The finishcallback.

string $creationType: The creation entity type.

string $updateType: The update entity type.

File

src/Processors/BatchImportProcessor.php, line 34

Class

BatchImportProcessor
Batch Import.

Namespace

Drupal\content_synchronizer\Processors

Code

public function import(ImportEntity $import, array $entitiesToImport, $finishCallBack = NULL, $creationType = ImportProcessor::PUBLICATION_UNPUBLISH, $updateType = ImportProcessor::UPDATE_IF_RECENT) {
  $operations = $this
    ->getBatchOperations($import, $entitiesToImport, $finishCallBack, $creationType, $updateType);
  $batch = [
    'title' => t('Importing entities...'),
    'operations' => $operations,
    'finished' => get_called_class() . '::onFinishBatchProcess',
  ];
  batch_set($batch);
}