You are here

public function SmartlingApiWrapper::searchOnlyTranslationRequest in TMGMT Translator Smartling 8.4

Returns translation request (without submission) by search params.

Parameters

$bucketName:

\Smartling\TranslationRequests\Params\SearchTranslationRequestParams $params:

Return value

mixed

File

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

Class

SmartlingApiWrapper
Class SmartlingApiWrapper @package Drupal\tmgmt_smartling\Smartling

Namespace

Drupal\tmgmt_smartling\Smartling

Code

public function searchOnlyTranslationRequest($bucketName, SearchTranslationRequestParams $params) {
  $result = [];
  try {
    $response = $this
      ->getApi('translation_request_v3')
      ->searchTranslationRequests($bucketName, $params);
    $result = $response['items'];
  } catch (SmartlingApiException $e) {
    $this->logger
      ->error('Smartling failed to search translation request:<br/>
      Bucket name: @bucket
      Params: @params
      Error: @error', [
      '@bucket' => $bucketName,
      '@params' => json_encode($params
        ->exportToArray()),
      '@error' => $e
        ->getMessage(),
    ]);
  }
  return $result;
}