vote() public method

public vote ( $reqid, $reward )
Exemplo n.º 1
0
     $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;