1 | <?php |
||
7 | final class CollectionFilter extends Filter implements \Countable |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | private $field; |
||
14 | |||
15 | /** |
||
16 | * @var FilterValue[] |
||
17 | */ |
||
18 | private $values; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $satisfiedBy; |
||
24 | |||
25 | /** |
||
26 | * CollectionFilter constructor. |
||
27 | * @param string $field |
||
28 | * @param Filtervalue[] $values |
||
29 | * @param string $satisfiedBy |
||
30 | * @throws \InvalidArgumentException |
||
31 | */ |
||
32 | public function __construct(string $field, array $values = [], string $satisfiedBy = self::SATISFIED_BY_ANY) |
||
43 | |||
44 | /** |
||
45 | * @param string $field |
||
46 | * @param array $values |
||
47 | * @param string $satisfiedBy |
||
48 | * @return CollectionFilter |
||
49 | * @throws \InvalidArgumentException |
||
50 | */ |
||
51 | public static function createFromValues(string $field, array $values, string $satisfiedBy = self::SATISFIED_BY_ANY) |
||
61 | |||
62 | /** |
||
63 | * @inheritDoc |
||
64 | */ |
||
65 | public function getValues(): array |
||
71 | |||
72 | /** |
||
73 | * @return FilterValue[] |
||
74 | */ |
||
75 | public function getFilterValues() |
||
79 | |||
80 | /*** |
||
81 | * @param $value |
||
82 | * @return CollectionFilter |
||
83 | */ |
||
84 | public function withoutValue($value): self |
||
97 | |||
98 | /** |
||
99 | * @param $value |
||
100 | * @return bool |
||
101 | */ |
||
102 | public function contains($value): bool |
||
110 | |||
111 | /** |
||
112 | * @inheritDoc |
||
113 | */ |
||
114 | public function getField(): string |
||
118 | |||
119 | /** |
||
120 | * @return string |
||
121 | */ |
||
122 | public function getSatisfiedBy(): string |
||
126 | |||
127 | /** |
||
128 | * @inheritDoc |
||
129 | */ |
||
130 | public function count() |
||
134 | |||
135 | /** |
||
136 | * @inheritDoc |
||
137 | */ |
||
138 | public function getType(): string |
||
142 | |||
143 | /** |
||
144 | * @inheritDoc |
||
145 | */ |
||
146 | public function jsonSerialize(): array |
||
165 | } |
||
166 |