You are here

public function Lingotek::deleteDocument in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/Lingotek.php \Drupal\lingotek\Lingotek::deleteDocument()

Deletes the document with this document id from the Lingotek service.

Parameters

string $doc_id: The document id in Lingotek.

Return value

bool TRUE if the document was successfully deleted. FALSE if not.

Overrides LingotekInterface::deleteDocument

File

src/Lingotek.php, line 225
Contains \Drupal\lingotek\Lingotek.

Class

Lingotek

Namespace

Drupal\lingotek

Code

public function deleteDocument($doc_id) {
  $response = $this->api
    ->deleteDocument($doc_id);
  $status_code = $response
    ->getStatusCode();
  if ($status_code == Response::HTTP_NO_CONTENT || $status_code == Response::HTTP_ACCEPTED) {
    return TRUE;
  }
  return FALSE;
}