You are here

public function TranslationRequestManager::commitSuccessfulUpload in TMGMT Translator Smartling 8.4

Parameters

\Drupal\tmgmt\JobInterface $job:

$translation_request:

Return value

mixed

File

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

Class

TranslationRequestManager
Class TranslationRequestManager.

Namespace

Drupal\tmgmt_smartling\Smartling\Submission

Code

public function commitSuccessfulUpload(JobInterface $job, $translation_request) {
  $this
    ->initApiWrapper($job);
  if ($this
    ->isTranslationSubmissionMissed($translation_request)) {
    return FALSE;
  }
  $update_submission_params = new UpdateTranslationSubmissionParams();
  $update_submission_params
    ->setSubmittedDate(new \DateTime('now', new \DateTimeZone('UTC')))
    ->setTranslationSubmissionUid($translation_request['translationSubmissions'][0]['translationSubmissionUid']);
  $update_request_params = new UpdateTranslationRequestParams();
  $update_request_params
    ->addTranslationSubmission($update_submission_params);
  return $this->apiWrapper
    ->updateTranslationRequest($this
    ->getBucketName($job), $translation_request['translationRequestUid'], $update_request_params);
}