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