function HTTP_DELETE() { $json = new paloSantoJSON(); $pCore_AddressBook = new core_AddressBook(); $result = $pCore_AddressBook->delAddressBookContact($this->_idNumero); if ($result === FALSE) { $error = $pCore_AddressBook->getError(); if ($error["fc"] == "DBERROR") { header("HTTP/1.1 500 Internal Server Error"); } elseif ($error['fc'] == 'ADDRESSBOOK') { header("HTTP/1.1 404 Not Found"); } else { header("HTTP/1.1 400 Bad Request"); } $json->set_status("ERROR"); $json->set_error($error); return $json->createJSON(); } else { $json = new Services_JSON(); $response["message"] = "The contact was successfully deleted"; return $json->encode($response); } }
/** * Function that implements the SOAP call to remove a contact from the external address book. If an error exists a SOAP fault is * thrown * * @param mixed $request: * id: ID of the contact to remove * @return mixed Array with boolean data, true if was successful or false if an error exists */ public function delAddressBookContact($request) { $return = parent::delAddressBookContact($request->id); if (!$return) { $eMSG = parent::getError(); $this->objSOAPServer->fault($eMSG['fc'], $eMSG['fm'], $eMSG['cn'], $eMSG['fd'], 'fault'); } return array("return" => $return); }