/** * @param int $issue_id * @param int $note_id * @return array * @access protected */ public function getNote($issue_id, $note_id) { $note = Note::getNoteBySequence($issue_id, $note_id); if (count($note) < 1 || !is_array($note)) { throw new RemoteApiException('Note #' . $note_id . " does not exist for issue #{$issue_id}"); } return $note; }
function getNote($p) { $email = XML_RPC_decode($p->getParam(0)); $password = XML_RPC_decode($p->getParam(1)); $auth = authenticate($email, $password); if (is_object($auth)) { return $auth; } $issue_id = XML_RPC_decode($p->getParam(2)); $note_id = XML_RPC_decode($p->getParam(3)); $note = Note::getNoteBySequence($issue_id, $note_id); if (count($note) < 1 || !is_array($note)) { return new XML_RPC_Response(0, $XML_RPC_erruser + 1, "Note #" . $note_id . " does not exist for issue #{$issue_id}"); } // since xml-rpc has issues, lets base64 encode everything foreach ($note as $key => $val) { $note[$key] = base64_encode($val); } return new XML_RPC_Response(XML_RPC_Encode($note)); }