getMyRequests() public method

public getMyRequests ( )
Esempio n. 1
0
 case validateRoute('GET', 'requests'):
     $requests = new Requests($db, $user);
     list($requests, $total) = $requests->query((int) $_GET["index"], (int) $_GET["limit"], $_GET["sort"], $_GET["order"], $_GET["searchParams"]);
     httpResponse($requests, $total);
     break;
 case validateRoute('GET', 'requests/\\d+'):
     $requests = new Requests($db, $user);
     $movieData = new MovieData($db);
     $requestResponse = $requests->get($params[1]);
     $requestVotes = $requests->getVotes($params[1]);
     $movieDataResponse = $movieData->getData($requestResponse["imdbid"]);
     httpResponse(array("request" => $requestResponse, "votes" => $requestVotes, "movieData" => $movieDataResponse));
     break;
 case validateRoute('GET', 'requests/my'):
     $requests = new Requests($db, $user);
     httpResponse($requests->getMyRequests());
     break;
 case validateRoute('POST', 'requests'):
     $logs = new Logs($db, $user);
     $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"]));