You are here

public function LingotekConfigTranslationService::cancelDocument in Lingotek Translation 3.6.x

Same name and namespace in other branches
  1. 8.2 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
  2. 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
  3. 3.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
  4. 3.1.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
  5. 3.2.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
  6. 3.3.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
  7. 3.4.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
  8. 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
  9. 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::cancelDocument()
  10. 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 809

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

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;
}