public function Lingotek::getDocumentStatus in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 8 src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
- 8.2 src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
- 4.0.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
- 3.0.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
- 3.1.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
- 3.2.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
- 3.3.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
- 3.4.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
- 3.5.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
- 3.6.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
- 3.7.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
Gets a document status.
Parameters
string $doc_id: The document id.
Return value
bool TRUE if the document exists. FALSE if not.
Overrides LingotekInterface::getDocumentStatus
File
- src/
Lingotek.php, line 719
Class
- Lingotek
- The connecting class between Drupal and Lingotek
Namespace
Drupal\lingotekCode
public function getDocumentStatus($doc_id) {
// For now, a passthrough to the API object so the controllers do not
// need to include that class.
try {
$response = $this->api
->getDocumentStatus($doc_id);
if ($response
->getStatusCode() == Response::HTTP_OK) {
// If an exception didn't happen, the document is succesfully imported.
// The status value there is related with translation status, so we must
// ignore it.
return TRUE;
}
} catch (LingotekApiException $exception) {
return FALSE;
}
return FALSE;
}