You are here

public function LingotekApi::getDocument in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getDocument()
  2. 7.2 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getDocument()
  3. 7.4 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getDocument()
  4. 7.5 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getDocument()
  5. 7.6 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::getDocument()

Gets Lingotek Document data for the specified document.

Parameters

int $document_id: The ID of the Lingotek Document to retrieve.

Return value

mixed The API response object with Lingotek Document data, or FALSE on error.

File

lib/Drupal/lingotek/LingotekApi.php, line 488
Defines Drupal\lingotek\LingotekApi

Class

LingotekApi
@file Defines Drupal\lingotek\LingotekApi

Code

public function getDocument($document_id) {
  $documents =& drupal_static(__FUNCTION__);
  if (!empty($documents[$document_id])) {
    $document = $documents[$document_id];
  }
  else {
    $params = array(
      'documentId' => $document_id,
    );
    if ($document = $this
      ->request('getDocument', $params)) {
      $documents[$document_id] = $document;
    }
  }
  return $document;
}