You are here

public function LingotekBatchController::uploadSingle in Lingotek Translation 3.0.x

Same name and namespace in other branches
  1. 8 src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
  2. 8.2 src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
  3. 4.0.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
  4. 3.1.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
  5. 3.2.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
  6. 3.3.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
  7. 3.4.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
  8. 3.5.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
  9. 3.6.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
  10. 3.7.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
  11. 3.8.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::uploadSingle()
1 call to LingotekBatchController::uploadSingle()
LingotekBatchController::dispatch in src/Controller/LingotekBatchController.php

File

src/Controller/LingotekBatchController.php, line 36

Class

LingotekBatchController

Namespace

Drupal\lingotek\Controller

Code

public function uploadSingle($entity_type, $entity_id, LingotekProfile $profile = NULL) {
  $batch = [
    'title' => $this
      ->t('Uploading content to Lingotek'),
    'operations' => $this
      ->getUploadOperations($entity_type, [
      $entity_id,
    ]),
    'error_message' => t('An error happened.'),
    'finished' => 'lingotek_operation_content_upload_finished',
    'file' => drupal_get_path('module', 'lingotek') . '/lingotek.batch.inc',
  ];
  $redirect_url = \Drupal::urlGenerator()
    ->generate("entity.{$entity_type}.content_translation_overview", [
    $entity_type => $entity_id,
  ], UrlGeneratorInterface::ABSOLUTE_URL);
  batch_set($batch);
  return batch_process($redirect_url);
}