/** * Retrieve a single match record for a tournament. * * @param string $tournament * @param string $match * @return array */ public function getMatch($tournament, $match) { $response = Guzzle::get("tournaments/{$tournament}/matches/{$match}"); $match = new Match($response->match); $match->tournament_slug = $tournament; return $match; }
/** * Update/submit the score(s) for a match. * * @param array $params * @return Match */ public function update($params = []) { $response = Guzzle::put("tournaments/{$this->tournament_slug}/matches/{$this->id}", $params); return $this->updateModel($response->match); }
/** * Bulk add participants to a tournament (up until it is started). * * @param array $params * @return array */ public function bulkAddParticipant($params = []) { $response = Guzzle::post("tournaments/{$this->id}/participants/bulk_add", $params); $participants = []; foreach ($response->participant as $participant) { $participant = new Participant($participant); $participant->tournament_slug = $tournament; $participants[] = $participant; } return $participants; }