You are here

public function Lingotek::getDocumentStatus in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
  2. 4.0.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
  3. 3.0.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
  4. 3.1.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
  5. 3.2.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
  6. 3.3.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
  7. 3.4.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
  8. 3.5.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
  9. 3.6.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
  10. 3.7.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()
  11. 3.8.x src/Lingotek.php \Drupal\lingotek\Lingotek::getDocumentStatus()

Overrides LingotekInterface::getDocumentStatus

1 call to Lingotek::getDocumentStatus()
Lingotek::documentImported in src/Lingotek.php

File

src/Lingotek.php, line 316
Contains \Drupal\lingotek\Lingotek.

Class

Lingotek

Namespace

Drupal\lingotek

Code

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;
}