本文整理汇总了PHP中Draft::getDraftBySequence方法的典型用法代码示例。如果您正苦于以下问题:PHP Draft::getDraftBySequence方法的具体用法?PHP Draft::getDraftBySequence怎么用?PHP Draft::getDraftBySequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Draft
的用法示例。
在下文中一共展示了Draft::getDraftBySequence方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendDraft
/**
* @param int $issue_id
* @param int $draft_id
* @return string
* @access protected
*/
public function sendDraft($issue_id, $draft_id)
{
$draft = Draft::getDraftBySequence($issue_id, $draft_id);
AuthCookie::setProjectCookie(Issue::getProjectID($issue_id));
if (count($draft) < 1 || !is_array($draft)) {
throw new RemoteApiException('Draft #' . $draft_id . " does not exist for issue #{$issue_id}");
}
$res = Draft::send($draft['emd_id']);
if ($res == 1) {
return "Draft #{$draft_id} sent successfully.\n";
}
throw new RemoteApiException('Error sending Draft #' . $draft_id . "\n");
}
示例2: sendDraft
function sendDraft($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));
$draft_id = XML_RPC_decode($p->getParam(3));
$draft = Draft::getDraftBySequence($issue_id, $draft_id);
createFakeCookie($email, Issue::getProjectID($issue_id));
if (count($draft) < 1 || !is_array($draft)) {
return new XML_RPC_Response(0, $XML_RPC_erruser + 1, "Draft #" . $draft_id . " does not exist for issue #{$issue_id}");
}
$res = Draft::send($draft["emd_id"]);
if ($res == 1) {
return new XML_RPC_Response(XML_RPC_Encode("Draft #" . $draft_id . " sent successfully.\n"));
} else {
return new XML_RPC_Response(0, $XML_RPC_erruser + 1, "Error sending Draft #" . $draft_id . "\n");
}
}