You are here

public function TranslationRequestManager::upsertTranslationRequest in TMGMT Translator Smartling 8.4

Send jobs to Submission service.

Parameters

\Drupal\tmgmt\JobInterface $job:

Return value

mixed

File

src/Smartling/Submission/TranslationRequestManager.php, line 112

Class

TranslationRequestManager
Class TranslationRequestManager.

Namespace

Drupal\tmgmt_smartling\Smartling\Submission

Code

public function upsertTranslationRequest(JobInterface $job) {
  $this
    ->initApiWrapper($job);
  $translation_request = $this
    ->getTranslationRequest($job);
  if (empty($translation_request) || $this
    ->isTranslationSubmissionMissed($translation_request)) {
    $result = $this
      ->createNewTranslationRequest($job);
  }
  else {
    $result = $this
      ->updateExistingTranslationRequest($job, $translation_request);
  }
  return $result;
}