예제 #1
0
        array_push($players, $player);
    }
    $team["Players"] = $players;
    $response["Error"] = false;
    $response["Team"] = $team;
    echoRespnse(200, $response);
});
/**
 * Gets the competitions of a team for a particular season
 * method GET
 */
$app->get('/teams/:teamID/seasons/:seasonID/competitions', function ($teamID, $seasonID) use($app) {
    $req = $app->request();
    $response = array();
    $db = new DbHandler();
    $competitionResult = $db->getTeamCompetitionsBySeason($teamID, $seasonID);
    $competitions = array();
    while ($competition = $competitionResult->fetch_assoc()) {
        array_push($competitions, $competition);
    }
    $response["Error"] = false;
    $response["Competitions"] = $competitions;
    echoRespnse(200, $response);
});
/**
 * Gets the practice soccer matches of a team for a particular season
 * method GET
 */
$app->get('/teams/:teamID/seasons/:seasonID/practice-matches', function ($teamID, $seasonID) use($app) {
    $req = $app->request();
    $response = array();