Tournament Generator

HasPositions

Trait Positions

A trait for a Team class (maybe something else in the future) for logging positions (first, second,..).

Tags
author

Tomá? Vojík vojik@wboy.cz

since
0.4

Table of Contents

$groupResults  : array<string|int, mixed>
addDraw()  : $this
Adds a draw to the team
addLoss()  : $this
Adds a loss to the team
addSecond()  : $this
Add points for being second to the team
addThird()  : $this
Add points for being third to the team
addWin()  : $this
Adds a win to the team
removeDraw()  : $this
Remove a draw from the team
removeLoss()  : $this
Remove a loss from the team
removeSecond()  : $this
Remove points for being second from the team
removeThird()  : $this
Remove points for being third from the team
removeWin()  : $this
Remove a win from the team

Properties

$groupResults

public array<string|int, mixed> $groupResults = []
Tags
details

[

  • groupId => [
    • "group" => Group, # GROUP OBJECT
    • "points" => int 0, # NUMBER OF POINTS ACQUIRED
    • "score" => int 0, # SUM OF SCORE ACQUIRED
    • "wins" => int 0, # NUMBER OF WINS
    • "draws" => int 0, # NUMBER OF DRAWS
    • "losses" => int 0, # NUMBER OF LOSSES
    • "second" => int 0, # NUMBER OF TIMES BEING SECOND (ONLY FOR INGAME OPTION OF 3 OR 4)
    • "third" => int 0 # NUMBER OF TIMES BEING THIRD (ONLY FOR INGAME OPTION OF 4)
  • ] ]

Methods

addDraw()

Adds a draw to the team

public addDraw([string|int|null $groupId = '' ]) : $this
Parameters
$groupId : string|int|null = ''

An id of group to add the results from

Tags
throws
Exception

if the group results have not been added

uses
Group::getDrawPoints()

to retrieve the points to add

Return values
$this

addLoss()

Adds a loss to the team

public addLoss([string|int|null $groupId = '' ]) : $this
Parameters
$groupId : string|int|null = ''

An id of group to add the results from

Tags
throws
Exception

if the group results have not been added

uses
Group::getLossPoints()

to retrieve the points to add

Return values
$this

addSecond()

Add points for being second to the team

public addSecond([string|int|null $groupId = '' ]) : $this
Parameters
$groupId : string|int|null = ''

An id of group to add the results from

Tags
throws
Exception

if the group results have not been added

uses
Group::getSecondPoints()

to retrieve the points to add

Return values
$this

addThird()

Add points for being third to the team

public addThird([string|int|null $groupId = '' ]) : $this
Parameters
$groupId : string|int|null = ''

An id of group to add the results from

Tags
throws
Exception

if the group results have not been added

uses
Group::getThirdPoints()

to retrieve the points to add

Return values
$this

addWin()

Adds a win to the team

public addWin([string|int|null $groupId = '' ]) : $this
Parameters
$groupId : string|int|null = ''

An id of group to add the results from

Tags
throws
Exception

if the group results have not been added

uses
Group::getWinPoints()

to retrieve the points to add

Return values
$this

removeDraw()

Remove a draw from the team

public removeDraw([string|int|null $groupId = '' ]) : $this
Parameters
$groupId : string|int|null = ''

An id of group to add the results from

Tags
throws
Exception

if the group results have not been added

uses
Group::getDrawPoints()

to retrieve the points to add

Return values
$this

removeLoss()

Remove a loss from the team

public removeLoss([string|int|null $groupId = '' ]) : $this
Parameters
$groupId : string|int|null = ''

An id of group to add the results from

Tags
throws
Exception

if the group results have not been added

uses
Group::getLossPoints()

to retrieve the points to add

Return values
$this

removeSecond()

Remove points for being second from the team

public removeSecond([string|int|null $groupId = '' ]) : $this
Parameters
$groupId : string|int|null = ''

An id of group to add the results from

Tags
throws
Exception

if the group results have not been added

uses
Group::getSecondPoints()

to retrieve the points to add

Return values
$this

removeThird()

Remove points for being third from the team

public removeThird([string|int|null $groupId = '' ]) : $this
Parameters
$groupId : string|int|null = ''

An id of group to add the results from

Tags
throws
Exception

if the group results have not been added

uses
Group::getThirdPoints()

to retrieve the points to add

Return values
$this

removeWin()

Remove a win from the team

public removeWin([string|int|null $groupId = '' ]) : $this
Parameters
$groupId : string|int|null = ''

An id of group to add the results from

Tags
throws
Exception

if the group results have not been added

uses
Group::getWinPoints()

to retrieve the points to add

Return values
$this

Search results