public function LingotekApi::getDocumentTranslationStatuses in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getDocumentTranslationStatuses()
- 4.0.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getDocumentTranslationStatuses()
- 3.0.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getDocumentTranslationStatuses()
- 3.1.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getDocumentTranslationStatuses()
- 3.2.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getDocumentTranslationStatuses()
- 3.3.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getDocumentTranslationStatuses()
- 3.4.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getDocumentTranslationStatuses()
- 3.5.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getDocumentTranslationStatuses()
- 3.6.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getDocumentTranslationStatuses()
- 3.7.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getDocumentTranslationStatuses()
- 3.8.x src/Remote/LingotekApi.php \Drupal\lingotek\Remote\LingotekApi::getDocumentTranslationStatuses()
Overrides LingotekApiInterface::getDocumentTranslationStatuses
File
- src/
Remote/ LingotekApi.php, line 197 - Contains \Drupal\lingotek\Remote\LingotekApi.
Class
Namespace
Drupal\lingotek\RemoteCode
public function getDocumentTranslationStatuses($id) {
try {
$this->logger
->debug('Lingotek::getDocumentTranslationStatuses called with %id', [
'%id' => $id,
]);
$response = $this->lingotekClient
->get('/api/document/' . $id . '/translation');
} catch (\Exception $e) {
$this->logger
->error('Error getting document translation status (%id): %message.', [
'%id' => $id,
'%message' => $e
->getMessage(),
]);
throw new LingotekApiException('Failed to get document translation status: ' . $e
->getMessage());
}
$this->logger
->debug('getDocumentTranslationStatuses response received, code %code and body %body', [
'%code' => $response
->getStatusCode(),
'%body' => (string) $response
->getBody(TRUE),
]);
return $response;
}