-
Notifications
You must be signed in to change notification settings - Fork 9
4. Tournaments
$tournament = $challonge->getTournament('teamreflex-bracket1');
Returns Reflex\Challonge\DTO\Tournament
for the given bracket.
The bracket name syntax is: subdomain-bracketId. If you aren't using a subdomain, then you would just use bracketId.
$challonge->getTournaments();
As basic as it gets. Returns Reflex\Challonge\DTO\Tournament
for each bracket generated with the account attached to the current API key.
$params = [
'name' => "My First Bracket",
'tournament_type' => 'single elimination',
'subdomain' => "teamreflex",
'url' => str_random(16),
'hold_third_place_match' => true,
'show_rounds' => true,
];
$tournament = $challonge->createTournament($params);
You can see all available params here: http://api.challonge.com/v1/documents/tournaments/create
Will return a Reflex\Challonge\DTO\Tournament
instance for the given bracket.
$tournament->start();
Closes registration and begins the tournament. Will throw Reflex\Challonge\Exceptions\AlreadyStartedException
if the bracket has already been started.
$tournament->finalize();
Closes the tournament. Will throw Reflex\Challonge\Exceptions\StillRunningException
if the bracket has already been started.
$tournament->reset();
Resets the tournament, clearing all scores and attachments.
$params = [
'name' => "My First Updated Bracket",
];
$tournament->update($params);
Updates the tournament attributes.
$tournament->delete();
Deletes the tournament.
$params = [
'name' => "Player 1",
];
$tournament->addParticipant($params);
You can see all available params here: http://api.challonge.com/v1/documents/participants/create
Will return a Reflex\Challonge\DTO\Participant
instance.
$params = [
[
'name' => "Player 2",
],
[
'name' => "Player 3",
],
];
$tournament->bulkAddParticipant($params);
You can see all available params here: http://api.challonge.com/v1/documents/participants/create
Will return an array of Reflex\Challonge\DTO\Participant
instances.