Tournament Generator

FilterComparator

Class responsible for processing filters

Tags
author

Tomá? Vojík vojik@wboy.cz

since
0.3

Table of Contents

$val  : int
$what  : string
compare()  : bool
Compare a given team metric
calcAvg()  : int|float
Calculate a average of given metric
calcComparisonValue()  : float|int|null
Get the team's value to compare
calcMax()  : int|float
Find a maximum of given metric
calcMin()  : int|float
Find a minimum of given metric
calcSum()  : int|float
Calculate a sum of given metric

Properties

Methods

compare()

Compare a given team metric

public static compare(string $operation, int|float $val, string $how, string $what, Team $team, array<string|int, mixed> $groupsId) : bool
Parameters
$operation : string

How to aggregate the values (sum, avg, max, min)

$val : int|float

Value to compare to

$how : string

How to compare (<, >, <=, >=, =, !=)

$what : string

What team's metric to consider

$team : Team

Team to get the value from

$groupsId : array<string|int, mixed>

What groups to consider

Return values
bool

calcAvg()

Calculate a average of given metric

private static calcAvg(Team $team, array<string|int, mixed> $groupsId) : int|float
Parameters
$team : Team

Team to get the values from

$groupsId : array<string|int, mixed>

What groups to consider

Return values
int|float

calcComparisonValue()

Get the team's value to compare

private static calcComparisonValue(string $operation, Team $team, array<string|int, mixed> $groupsId) : float|int|null
Parameters
$operation : string

How to aggregate the values (sum, avg, max, min)

$team : Team

Team to get the value from

$groupsId : array<string|int, mixed>

What groups to consider

Return values
float|int|null

calcMax()

Find a maximum of given metric

private static calcMax(Team $team, array<string|int, mixed> $groupsId) : int|float
Parameters
$team : Team

Team to get the values from

$groupsId : array<string|int, mixed>

What groups to consider

Return values
int|float

calcMin()

Find a minimum of given metric

private static calcMin(Team $team, array<string|int, mixed> $groupsId) : int|float
Parameters
$team : Team

Team to get the values from

$groupsId : array<string|int, mixed>

What groups to consider

Return values
int|float

calcSum()

Calculate a sum of given metric

private static calcSum(Team $team, array<string|int, mixed> $groupsId) : int|float
Parameters
$team : Team

Team to get the values from

$groupsId : array<string|int, mixed>

What groups to consider

Return values
int|float

Search results