public function LingotekFake::getDocumentStatus in Lingotek Translation 3.7.x
Same name and namespace in other branches
- 8 tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
- 8.2 tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
- 4.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
- 3.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
- 3.1.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
- 3.2.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
- 3.3.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
- 3.4.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
- 3.5.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
- 3.6.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentStatus()
- 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
Namespace
Drupal\lingotek_testCode
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);
}