You are here

public function LingotekFake::getDocumentStatus in Lingotek Translation 4.0.x

Same name and namespace in other branches
  1. 8 tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
  2. 8.2 tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
  3. 3.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
  4. 3.1.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
  5. 3.2.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
  6. 3.3.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
  7. 3.4.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
  8. 3.5.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
  9. 3.6.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
  10. 3.7.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
  11. 3.8.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::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

tests/modules/lingotek_test/src/LingotekFake.php, line 291

Class

LingotekFake

Namespace

Drupal\lingotek_test

Code

public function getDocumentStatus($doc_id) {
  if (\Drupal::state()
    ->get('lingotek.must_error_in_check_source_status', FALSE)) {
    \Drupal::state()
      ->set('lingotek.must_error_in_check_source_status', FALSE);
    throw new LingotekApiException('Error was forced.');
  }
  if (\Drupal::state()
    ->get('lingotek.must_document_not_found_error_in_check_source_status', FALSE)) {
    throw new LingotekDocumentNotFoundException($doc_id . ' not found. Error was forced.');
  }
  return \Drupal::state()
    ->get('lingotek.document_status_completion', TRUE);
}