You are here

public function LingotekInterfaceTranslationService::cancelDocument in Lingotek Translation 3.2.x

Same name and namespace in other branches
  1. 4.0.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::cancelDocument()
  2. 3.3.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::cancelDocument()
  3. 3.4.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::cancelDocument()
  4. 3.5.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::cancelDocument()
  5. 3.6.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::cancelDocument()
  6. 3.7.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::cancelDocument()
  7. 3.8.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::cancelDocument()

Cancels a document from the server.

Parameters

string $component: The component which we want to cancel.

Return value

string The component.

Overrides LingotekInterfaceTranslationServiceInterface::cancelDocument

2 calls to LingotekInterfaceTranslationService::cancelDocument()
LingotekInterfaceTranslationService::deleteAllMetadata in src/LingotekInterfaceTranslationService.php
LingotekInterfaceTranslationService::deleteMetadata in src/LingotekInterfaceTranslationService.php
Deletes all local metadata related to an component.

File

src/LingotekInterfaceTranslationService.php, line 786

Class

LingotekInterfaceTranslationService
Service for managing Lingotek interface translations.

Namespace

Drupal\lingotek

Code

public function cancelDocument($component) {
  $result = FALSE;
  $doc_id = $this
    ->getDocumentId($component);
  if ($doc_id) {
    $result = $this->lingotek
      ->cancelDocument($doc_id);
    $this
      ->setDocumentId($component, NULL);
  }
  $this
    ->setSourceStatus($component, Lingotek::STATUS_CANCELLED);
  $this
    ->setTargetStatuses($component, Lingotek::STATUS_CANCELLED);
  return $result;
}