|Classes of Tomáš Vojík||>||PHP Tournament Bracket Generator||>||docs/examples/filters.md||>||Download|
Filters are special classes used in order to filter out teams only by some given criteria.
You can apply filters to
Creating a filter
List of criteria
List of criteria to filter teams by
| Criteria | Description | | :------: | :---------: | | points | points acquired | | score | score acquired | | wins | number of wins | | losses | number of losses | | draws | number of draws | | second | number of times where the team was second (at least 3 teams in game) | | third | number of times where the team was third (at least 4 teams in game) | | team | filter a specific team | | notprogressed | filter only teams that have not been progressed yet from certain group | | progressed | filter only teams that have been progressed from certain group |
Using a filter
A simple filter might be used in order to get for example only the teams that have won at least 3 times
This will filter all teams in a tournament and give you only the ones that satisfy given filter.
<a title="progressions" id="progressions"></a>
You can also use filters to progress teams. Imagine a situation where you progress 2 best teams from one group and you want to progress all others to another. We can do this, no matter the number of teams with a filter.
This will move 2 best teams from
More complex filters
If you need to, you can also combine filters to create more complex filters. This uses a helper Filter class.
One way of combining filters is creating a list of them. Then it will require the teams to satisfy all of them.
This will filter only the teams that have more than 2 wins and less than 4 losses.
If you want to combine the filters in much more complex way, you can create a multi-dimensional array of your filters using and and or keys;
This will give you all the teams that have more than 400 score and more then 2 wins or less then 4 losses.
And if you ever want to filter teams with double or or and, you can wrap it in an array like so.
Applying more complex filters to progressions
If you want to add complex filters to progressions you can just add more with:
and this filter teams that satisfy both: filter1 and filter2.
However, if you want to use complex filters with set operators, you have to use