You are here

protected function LingotekManagementForm::createDebugExportBatch in Lingotek Translation 8

Create and set an export batch.

Parameters

array $values: Array of ids to upload.

1 call to LingotekManagementForm::createDebugExportBatch()
LingotekManagementForm::submitForm in src/Form/LingotekManagementForm.php
Form submission handler.

File

src/Form/LingotekManagementForm.php, line 525
Contains \Drupal\Lingotek\Form\LingotekManagementForm.

Class

LingotekManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

protected function createDebugExportBatch($values) {
  $entities = $this->entityManager
    ->getStorage($this->entityTypeId)
    ->loadMultiple($values);
  foreach ($entities as $entity) {
    $operations[] = [
      [
        $this,
        'debugExport',
      ],
      [
        $entity,
      ],
    ];
  }
  $batch = array(
    'title' => $this
      ->t('Exporting content (debugging purposes)'),
    'operations' => $operations,
    'finished' => [
      $this,
      'debugExportFinished',
    ],
    'progressive' => TRUE,
  );
  batch_set($batch);
}