本文整理匯總了PHP中Requests::vote方法的典型用法代碼示例。如果您正苦於以下問題:PHP Requests::vote方法的具體用法?PHP Requests::vote怎麽用?PHP Requests::vote使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Requests
的用法示例。
在下文中一共展示了Requests::vote方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Requests
$requests = new Requests($db, $user, $logs);
httpResponse($requests->createOrUpdate($postdata));
break;
case validateRoute('PATCH', 'requests/\\d+'):
$requests = new Requests($db, $user);
httpResponse($requests->createOrUpdate($postdata, (int) $params[1]));
break;
case validateRoute('DELETE', 'requests/\\d+'):
$logs = new Logs($db, $user);
$mailbox = new Mailbox($db, $user);
$requests = new Requests($db, $user, $logs, $mailbox);
httpResponse($requests->delete($params[1], $_GET["reason"]));
break;
case validateRoute('POST', 'requests/\\d+/votes'):
$requests = new Requests($db, $user);
$response = $requests->vote($params[1], (int) $postdata["reward"]);
httpResponse($response);
break;
case validateRoute('GET', 'mailbox'):
$mailbox = new Mailbox($db, $user);
list($result, $totalCount) = $mailbox->query((int) $_GET["location"] ?: 0, (int) $_GET["limit"] ?: 10, (int) $_GET["index"] ?: 0);
httpResponse($result, $totalCount);
break;
case validateRoute('PATCH', 'mailbox/\\d+'):
$mailbox = new Mailbox($db, $user);
httpResponse($mailbox->update((int) $params[1], $postdata));
break;
case validateRoute('POST', 'mailbox'):
$mailbox = new Mailbox($db, $user);
httpResponse($mailbox->create($postdata));
break;