public function LingotekFake::cancelDocumentTarget 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::cancelDocumentTarget()
- 4.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocumentTarget()
- 3.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocumentTarget()
- 3.1.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocumentTarget()
- 3.2.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocumentTarget()
- 3.3.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocumentTarget()
- 3.4.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocumentTarget()
- 3.6.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocumentTarget()
- 3.7.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocumentTarget()
- 3.8.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::cancelDocumentTarget()
Cancels the document target with this document id and locale from the Lingotek service.
Parameters
string $doc_id: The document id in Lingotek.
string $locale: The locale target we want to cancel the translation.
Return value
bool TRUE if the document target was successfully cancelled. FALSE if not.
Overrides LingotekInterface::cancelDocumentTarget
File
- tests/
modules/ lingotek_test/ src/ LingotekFake.php, line 355
Class
Namespace
Drupal\lingotek_testCode
public function cancelDocumentTarget($doc_id, $locale) {
if (\Drupal::state()
->get('lingotek.must_error_in_cancel', FALSE)) {
throw new LingotekApiException('Error was forced.');
}
$cancelled_locales = \Drupal::state()
->get('lingotek.cancelled_locales', []);
$cancelled_locales[$doc_id][] = $locale;
\Drupal::state()
->set('lingotek.cancelled_locales', $cancelled_locales);
// Cancelled locale target.
return TRUE;
}