Progression
in package
Progression is a class that takes care of moving teams between groups.
Progressions are used in order to move teams from one group to another. This can be used to progress the winning teams to semi-finals and finals round, but you can also progress teams between groups in different categories and even tournaments if you ever needed to. Progressions use a similar syntax to php's array_slice() function or it can use defined filters.
Tags
Table of Contents
- $filters : array<string|int, mixed>
- $from : Group
- $len : int|null
- $progressed : bool
- $start : int
- $to : Group
- __construct() : mixed
- Progression constructor.
- __toString() : string
- Gets a description
- addFilter() : $this
- Adds progression's filters
- getFilters() : array<string|int, TeamFilter>
- getFrom() : Group
- getLen() : int|null
- getStart() : int
- getTo() : Group
- isProgressed() : bool
- progress() : $this
- Progress the teams using set rules
- reset() : $this
- Reset progression
- setFilters() : $this
- Sets progression's filters
- setProgressed() : void
Properties
$filters
protected
array<string|int, mixed>
$filters
= []
$from
protected
Group
$from
$len
protected
int|null
$len
$progressed
protected
bool
$progressed
= false
$start
protected
int
$start
$to
protected
Group
$to
Methods
__construct()
Progression constructor.
public
__construct(Group $from, Group $to, int $start[, int|null $len = null ]) : mixed
Parameters
- $from : Group
-
What group to progress from
- $to : Group
-
What group to progress to
- $start : int
-
Offset to start picking teams
- $len : int|null = null
-
Maximum number of teams to progress
Return values
mixed —__toString()
Gets a description
public
__toString() : string
Return values
string —addFilter()
Adds progression's filters
public
addFilter(array<string|int, TeamFilter> ...$filters) : $this
Parameters
- $filters : array<string|int, TeamFilter>
Return values
$this —getFilters()
public
getFilters() : array<string|int, TeamFilter>
Return values
array<string|int, TeamFilter> —getFrom()
public
getFrom() : Group
Return values
Group —getLen()
public
getLen() : int|null
Return values
int|null —getStart()
public
getStart() : int
Return values
int —getTo()
public
getTo() : Group
Return values
Group —isProgressed()
public
isProgressed() : bool
Return values
bool —progress()
Progress the teams using set rules
public
progress([bool $blank = false ]) : $this
Parameters
- $blank : bool = false
-
If true -> do not move the real team objects, but create new dummy teams
Tags
Return values
$this —reset()
Reset progression
public
reset() : $this
Tags
Return values
$this —setFilters()
Sets progression's filters
public
setFilters(array<string|int, TeamFilter> $filters) : $this
Parameters
- $filters : array<string|int, TeamFilter>
Return values
$this —setProgressed()
public
setProgressed(bool $progressed) : void
Parameters
- $progressed : bool