public static function resetNodeInfoByDocId($lingotek_document_id) { $doc_ids = is_array($lingotek_document_id) ? $lingotek_document_id : array($lingotek_document_id); $count = 0; foreach ($doc_ids as $doc_id) { $node_id = LingotekSync::getNodeIdFromDocId($doc_id); // grab before node info is removed LingotekSync::removeNodeInfoByDocId($doc_id); //remove locally (regardless of success remotely) if ($node_id !== FALSE) { LingotekSync::setNodeStatus($node_id, LingotekSync::STATUS_EDITED); $count++; } } return $count; }
public function removeDocument($document_id, $reset_node = TRUE) { $success = FALSE; if ($document_id && (is_numeric($document_id) || is_array($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; }