You are here

public function LingotekApi::removeDocument in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 7.3 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::removeDocument()
  2. 7.5 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::removeDocument()
  3. 7.6 lib/Drupal/lingotek/LingotekApi.php \LingotekApi::removeDocument()

File

lib/Drupal/lingotek/LingotekApi.php, line 141
Defines Drupal\lingotek\LingotekApi

Class

LingotekApi
@file Defines Drupal\lingotek\LingotekApi

Code

public function removeDocument($document_id, $reset_node = TRUE) {
  $success = FALSE;
  if ($document_id) {

    // Remove node info from lingotek table (and reset for upload when reset_node is TRUE)
    if ($reset_node) {
      LingotekSync::resetNodeInfoByDocId($document_id);
    }
    else {
      LingotekSync::removeNodeInfoByDocId($document_id);
    }
    $result = $this
      ->request('removeDocument', array(
      'documentId' => $document_id,
    ));
    if ($result) {
      $success = TRUE;
    }
  }
  return $success;
}