setCallId(@(int)filter_input(INPUT_POST, 'CALL_ID', FILTER_SANITIZE_SPECIAL_CHARS)); $CallsDraftsValidate->setCallDraftId(@(int)filter_input(INPUT_POST, 'CALL_DRAFT_ID', FILTER_SANITIZE_SPECIAL_CHARS)); /** Verifico a existência de erros */ if (!empty($CallsDraftsValidate->getErrors())) { /** Retorno mensagem de erro */ throw new InvalidArgumentException($CallsDraftsValidate->getErrors(), 0); } else { /** Verifico se o usuário foi localizado */ if ($CallsDrafts->delete($CallsDraftsValidate->getCallDraftId())) { /** Result **/ $result = [ 'cod' => 200, 'title' => 'Sucesso', 'message' => 'Registro removido com sucesso', 'redirect' => 'FOLDER=VIEW&TABLE=CALLS&ACTION=CALLS_DETAILS&CALL_ID=' . $CallsDraftsValidate->getCallId() ]; } else { /** Retorno mensagem de erro */ throw new InvalidArgumentException('Não foi possivel remover o registro', 0); } } /** Envio **/ echo json_encode($result); /** Paro o procedimento **/ exit; } catch (Exception $exception) { /** Preparo o formulario para retorno **/ $result = [ 'cod' => 0, 'message' => '