You are here

function getJobDemo in TMGMT Translator Smartling 8.3

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

Parameters

\Smartling\AuthApi\AuthApiInterface $authProvider:

string $projectId:

string $jobId:

Return value

bool

1 call to getJobDemo()
jobs-example.php in vendor/smartling/api-sdk-php/examples/jobs-example.php

File

vendor/smartling/api-sdk-php/examples/jobs-example.php, line 191

Code

function getJobDemo($authProvider, $projectId, $jobId) {
  echo "--- Get job ---\n";
  $jobs = \Smartling\Jobs\JobsApi::create($authProvider, $projectId);
  $info = FALSE;
  $st = microtime(true);
  try {
    $info = $jobs
      ->getJob($jobId);
  } 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($info)) {
    var_dump($info);
  }
  return $info;
}