You are here

public function SmartlingTranslator::requestTranslationExtended in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/tmgmt/Translator/SmartlingTranslator.php \Drupal\tmgmt_smartling\Plugin\tmgmt\Translator\SmartlingTranslator::requestTranslationExtended()

Requests translation.

Parameters

\Drupal\tmgmt\JobInterface $job:

array $data:

Return value

mixed

File

src/Plugin/tmgmt/Translator/SmartlingTranslator.php, line 814
Contains \Drupal\tmgmt_smartling\Plugin\tmgmt\Translator\SmartlingTranslator.

Class

SmartlingTranslator
Smartling translator plugin.

Namespace

Drupal\tmgmt_smartling\Plugin\tmgmt\Translator

Code

public function requestTranslationExtended(JobInterface $job, array $data) {

  // Pass queue item data into job settings.
  $settings_map_item = $job->settings
    ->get(0);
  if ($settings_map_item) {
    $settings = $settings_map_item
      ->getValue();
    if (isset($data['batch_uid'])) {
      $settings['batch_uid'] = $data['batch_uid'];
    }
    if ($data['batch_execute_on_job']) {
      $settings['batch_execute_on_job'] = $data['batch_execute_on_job'];
    }
    $job->settings
      ->set(0, $settings);
  }
  $this
    ->requestTranslation($job);
}