You are here

function getTranslationRequestDemo in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 vendor/smartling/api-sdk-php/examples/translation-requests-example.php \getTranslationRequestDemo()

Parameters

Smartling\AuthApi\AuthApiInterface $authProvider:

$projectId:

$demoBucketName:

$translationRequestUid:

Return value

array

1 call to getTranslationRequestDemo()
translation-requests-example.php in vendor/smartling/api-sdk-php/examples/translation-requests-example.php

File

vendor/smartling/api-sdk-php/examples/translation-requests-example.php, line 120

Code

function getTranslationRequestDemo($authProvider, $projectId, $demoBucketName, $translationRequestUid) {
  echo "--- Get Translation Request ---\n";
  $response = [];
  $translationRequestsApi = \Smartling\TranslationRequests\TranslationRequestsApi::create($authProvider, $projectId);
  $st = microtime(true);
  try {
    $response = $translationRequestsApi
      ->getTranslationRequest($demoBucketName, $translationRequestUid);
  } catch (\Smartling\Exceptions\SmartlingApiException $e) {
    var_dump($e
      ->getErrors());
  }
  $et = microtime(true);
  $time = $et - $st;
  echo vsprintf('Request took %s seconds.%s', [
    round($time, 3),
    "\n\r",
  ]);
  if (!empty($response)) {
    var_dump($response);
  }
  return $response;
}