/** * Function to change the visibility of a document * * @param string $document_guid - the guid of the document to change visibility * @param int $visibility - the visibility that the document has to become * @return bool - $the result of the change */ function visibilityService($document_guid, $visibility) { $index_address = DLEApi::getSetting('index_address'); if ($index_address == '') { $this->log('Index address not found'); return false; } $soap_client = $this->initSoapClient($index_address); if ($soap_client == false) { $this->log('... Connection problem.'); return false; } // Call the SOAP method... try { $soap_client->IndexDocument(array('documentGuid' => $document_guid, 'indexType' => $visibility)); DLEApi::changeVisibility($document_guid, $visibility); return true; } catch (SoapFault $e) { $this->log('Document (' . $document_guid . ') index change. error received - Error: ' . $e->getMessage()); return false; } }