Tournament Generator

WithGames

Trait WithGames

Tags
author

Tomáš Vojík vojik@wboy.cz

since
0.4

Table of Contents

$games  : GameContainer
addGameContainer()  : WithGames
Add a child container for games
getGameContainer()  : GameContainer
Get the container for games
getGames()  : array<string|int, Game>
Get all tournament games
setGameAutoincrementId()  : WithGames
Sets a new autoincrement value (start) for the generated games
setResults()  : Game|null
Set the game's results

Properties

Methods

getGames()

Get all tournament games

public getGames() : array<string|int, Game>
Return values
array<string|int, Game>

setGameAutoincrementId()

Sets a new autoincrement value (start) for the generated games

public setGameAutoincrementId(int $id) : WithGames
Parameters
$id : int

Id - probably from the database

Tags
warning

Do this on the top-level hierarchy element (Tournament class) or else, it might be reset later

post

Propagates the value to all child hierarchy objects

see
GameContainer::setAutoIncrement()
since
0.5
Return values
WithGames

setResults()

Set the game's results

public setResults(array<string|int, int> $results) : Game|null

Results is an array of [teamId => teamScore] key-value pairs. This method will look for a game with given teams and try to set the first not played.

Parameters
$results : array<string|int, int>

array of [teamId => teamScore] key-value pairs

Tags
throws
Exception
Return values
Game|null

Search results