public function LingotekFake::cancelDocument in Lingotek Translation 3.5.x
Same name and namespace in other branches
- 8.2 tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocument()
- 4.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocument()
- 3.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocument()
- 3.1.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocument()
- 3.2.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocument()
- 3.3.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocument()
- 3.4.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocument()
- 3.6.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocument()
- 3.7.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocument()
- 3.8.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocument()
Cancels the document with this document id from the Lingotek service.
Parameters
string $doc_id: The document id in Lingotek.
Return value
bool TRUE if the document was successfully cancelled. FALSE if not.
Overrides LingotekInterface::cancelDocument
File
- tests/
modules/ lingotek_test/ src/ LingotekFake.php, line 342
Class
Namespace
Drupal\lingotek_testCode
public function cancelDocument($doc_id) {
if (\Drupal::state()
->get('lingotek.must_error_in_cancel', FALSE)) {
throw new LingotekApiException('Error was forced.');
}
$cancelled_docs = \Drupal::state()
->get('lingotek.cancelled_docs', []);
$cancelled_docs[] = $doc_id;
\Drupal::state()
->set('lingotek.cancelled_docs', $cancelled_docs);
return TRUE;
}