public function LingotekConfigTranslationService::cancelDocument in Lingotek Translation 3.1.x
Same name and namespace in other branches
- 8.2 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
- 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
- 3.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
- 3.2.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
- 3.3.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
- 3.4.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
- 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
- 3.6.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
- 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
- 3.8.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
Cancels a document from the server.
Parameters
\Drupal\Core\Config\Entity\ConfigEntityInterface &$entity: The entity which we want to cancel.
Return value
\Drupal\Core\Config\Entity\ConfigEntityInterface The entity.
Overrides LingotekConfigTranslationServiceInterface::cancelDocument
1 call to LingotekConfigTranslationService::cancelDocument()
- LingotekConfigTranslationService::deleteMetadata in src/
LingotekConfigTranslationService.php - Deletes metadata.
File
- src/
LingotekConfigTranslationService.php, line 797
Class
- LingotekConfigTranslationService
- Service for managing Lingotek configuration translations.
Namespace
Drupal\lingotekCode
public function cancelDocument(ConfigEntityInterface &$entity) {
$result = FALSE;
$doc_id = $this
->getDocumentId($entity);
if ($doc_id) {
$result = $this->lingotek
->cancelDocument($doc_id);
$this->lingotekConfiguration
->setConfigEntityProfile($entity, NULL);
$this
->setDocumentId($entity, NULL);
}
$this
->setSourceStatus($entity, Lingotek::STATUS_CANCELLED);
$this
->setTargetStatuses($entity, Lingotek::STATUS_CANCELLED);
return $result;
}