Tournament Generator

Teams

TournamentGenerator sorter for teams

Tags
author

Tomá? Vojík vojik@wboy.cz

since
0.3

Table of Contents

$ids  : array<string|int, mixed>
sortGroup()  : array<string|int, Team>
Sort teams in group by defined ordering type
sortRound()  : array<string|int, Team>
Sort teams in round by defined ordering type
sortTeamsByPoints()  : int
Sorter function for usort by points
sortTeamsByScore()  : int
Sorter function for usort by score

Properties

$ids

protected static array<string|int, mixed> $ids = []

Methods

sortGroup()

Sort teams in group by defined ordering type

public static sortGroup(array<string|int, Team&$teams, Group $group[, string $ordering = Constants::POINTS ]) : array<string|int, Team>
Parameters
$teams : array<string|int, Team>

Array of teams to be sorted

$group : Group

Group to get the results from

$ordering : string = Constants::POINTS

What to order by (\TournamentGenerator\Constants::POINTS / \TournamentGenerator\Constants::SCORE)

Tags
throws
Exception
Return values
array<string|int, Team>

Sorted array of teams

sortRound()

Sort teams in round by defined ordering type

public static sortRound(array<string|int, Team&$teams, Round $round[, string $ordering = Constants::POINTS ]) : array<string|int, Team>
Parameters
$teams : array<string|int, Team>

Array of teams to be sorted

$round : Round

Round to get the results from

$ordering : string = Constants::POINTS

What to order by (\TournamentGenerator\Constants::POINTS / \TournamentGenerator\Constants::SCORE)

Tags
throws
Exception
Return values
array<string|int, Team>

Sorted array of teams

sortTeamsByPoints()

Sorter function for usort by points

private static sortTeamsByPoints(Team $a, Team $b) : int
Parameters
$a : Team

First team

$b : Team

Second team

Return values
int

sortTeamsByScore()

Sorter function for usort by score

private static sortTeamsByScore(Team $a, Team $b) : int
Parameters
$a : Team

First team

$b : Team

Second team

Return values
int

Search results