You are here

public function SmartlingApiWrapper::getJob in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.3 src/Smartling/SmartlingApiWrapper.php \Drupal\tmgmt_smartling\Smartling\SmartlingApiWrapper::getJob()

Returns job.

Parameters

$job_id:

Return value

array

File

src/Smartling/SmartlingApiWrapper.php, line 212
SmartlingApiWrapper.php.

Class

SmartlingApiWrapper
Class SmartlingApiWrapper @package Drupal\tmgmt_smartling\Smartling

Namespace

Drupal\tmgmt_smartling\Smartling

Code

public function getJob($job_id) {
  $result = [];
  try {
    $result = $this
      ->getApi('jobs')
      ->getJob($job_id);
  } catch (SmartlingApiException $e) {
    $this->logger
      ->error('Smartling failed to fetch a job:<br/>
      Job id: @job_id
      Error: @error', [
      '@job_id' => $job_id,
      '@error' => $e
        ->getMessage(),
    ]);
  }
  return $result;
}