Tournament Generator

HasScore

Trait HasScore

A trait for a Team object that adds the ability to calculate scores / points.

Tags
author

Tomáš Vojík vojik@wboy.cz

since
0.4

Table of Contents

$sumPoints  : int
$sumScore  : int
addPoints()  : $this
Adds points to the total sum
addScore()  : $this
Adds score to the total sum
getSumPoints()  : int
Gets all points that the team has acquired through the tournament
getSumScore()  : int
Gets all score that the team has acquired through the tournament
removePoints()  : $this
Removes points to the total sum
removeScore()  : $this
Removes score to the total sum
sumPoints()  : int
Calculate all the points acquired from given group ids
sumScore()  : int
Calculate all score acquired from given group ids

Properties

Methods

addPoints()

Adds points to the total sum

public addPoints(int $points) : $this
Parameters
$points : int

Points to add

Return values
$this —

addScore()

Adds score to the total sum

public addScore(int $score) : $this
Parameters
$score : int

Score to add

Return values
$this —

getSumPoints()

Gets all points that the team has acquired through the tournament

public getSumPoints() : int
Return values
int —

Sum of the points acquired

getSumScore()

Gets all score that the team has acquired through the tournament

public getSumScore() : int
Return values
int —

Sum of the score acquired

removePoints()

Removes points to the total sum

public removePoints(int $points) : $this
Parameters
$points : int

Points to remove

Return values
$this —

removeScore()

Removes score to the total sum

public removeScore(int $score) : $this
Parameters
$score : int

Score to add

Return values
$this —

sumPoints()

Calculate all the points acquired from given group ids

public sumPoints([array<string|int, mixed> $groupIds = [] ]) : int
Parameters
$groupIds : array<string|int, mixed> = []

Array of group ids

Return values
int —

Sum of the points or sum of all points if argument is empty

sumScore()

Calculate all score acquired from given group ids

public sumScore([array<string|int, mixed> $groupIds = [] ]) : int
Parameters
$groupIds : array<string|int, mixed> = []

Array of group ids

Return values
int —

Sum of score or sum of all score if argument is empty

Search results