Bracket Round API Functions
Detailed Description
Rounds
Bracket matches are organized under rounds. The number of rounds is established at bracket creation time and is determined by the number of competitors and the type of bracket - which is governed by the bracket design. In the case of double-elimination bracket designs, rounds are separated into winner and loser rounds.
An example of round and match indexing:
(Winner Rounds)
(Round 1) (Round 2) (Round 3) (Round 4) (Round 5)
-----------+
(Match 1) |-----------+
-----------+ |
(Match 1) +-----------+
-----------+ | |
(Match 2) |-----------+ |
-----------+ |
(Match 1) +----------------+
-----------+ | |
(Match 3) |-----------+ | |
-----------+ | | |
(Match 2) +-----------+ |
-----------+ | |
(Match 4) |-----------+ (Match 1) |--------------+
-----------+ | |
|
(Loser Rounds) | |
|
(Round 6) (Round 7) (Round 8) (Round 9) | |
-----------+ | (Match 1) + - - - -
-----------+ | | |
-----------+ (Match 1) |-----------+ (Match 1) +----+
(Match 1) |-----------+ | | |
-----------+ (Match 1) +-----------+
-----------+ | |
-----------+ (Match 2) |-----------+ - - - - - - - +
(Match 2) |-----------+
-----------+
Function Documentation
bracket_api_get_round |
( |
$ |
node, |
|
|
$ |
round_index | |
|
) |
| | |
Return an array containing the information in the round object at the given index
- Parameters:
-
| $node | the bracket node |
| $round_index | the index of the round to return |
- Returns:
- an array containing round information or FALSE if round index does not exist
bracket_api_get_rounds |
( |
$ |
node |
) |
|
Return an associative array of all rounds in the bracket
- Parameters:
-
- Returns:
- the array of rounds
bracket_api_locate_round |
( |
$ |
node, |
|
|
$ |
name | |
|
) |
| | |
Locate a round by name
- Parameters:
-
| $node | the bracket node |
| $name | the name of the round to locate |
- Returns:
- the index or the round or FALSE if not found
bracket_api_set_round_comment |
( |
&$ |
node, |
|
|
$ |
index, |
|
|
$ |
comment | |
|
) |
| | |
Set a round comment
- Parameters:
-
| $node | the bracket node |
| $index | the round index to update |
| $comment | the new comment for the round |
bracket_api_set_round_name |
( |
&$ |
node, |
|
|
$ |
index, |
|
|
$ |
name | |
|
) |
| | |
Set a round name
- Parameters:
-
| $node | the bracket node |
| $index | the round index to update |
| $name | the new name of the round |