1 | <?php |
||
11 | final class FilterComponent implements ComponentInterface, IteratorAggregate, Countable, JsonSerializable |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * @var Filter[] |
||
16 | */ |
||
17 | private $filters = []; |
||
18 | |||
19 | /** |
||
20 | * FilterComponent constructor. |
||
21 | * @param Filter[] $filters |
||
22 | */ |
||
23 | public function __construct(array $filters = []) |
||
29 | |||
30 | /** |
||
31 | * @inheritDoc |
||
32 | */ |
||
33 | public static function getName(): string |
||
37 | |||
38 | /** |
||
39 | * @param Filter $filter |
||
40 | */ |
||
41 | public function add(Filter $filter): void |
||
45 | |||
46 | /** |
||
47 | * @param string $field |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function has(string $field): bool |
||
60 | |||
61 | /** |
||
62 | * @param string $field |
||
63 | * @return Filter |
||
64 | * @throws \InvalidArgumentException |
||
65 | */ |
||
66 | public function get(string $field): Filter |
||
76 | |||
77 | /** |
||
78 | * @return Filter[] |
||
79 | */ |
||
80 | public function all(): array |
||
84 | |||
85 | /** |
||
86 | * @return Filter[] |
||
87 | */ |
||
88 | public function getAppliedFilters(): array |
||
99 | |||
100 | /** |
||
101 | * @return Filter[] |
||
102 | */ |
||
103 | public function getIterator(): iterable |
||
107 | |||
108 | /** |
||
109 | * @inheritDoc |
||
110 | */ |
||
111 | public function count() |
||
115 | |||
116 | /** |
||
117 | * @inheritDoc |
||
118 | */ |
||
119 | public function jsonSerialize(): array |
||
123 | } |
||
124 |