1 | <?php |
||
27 | class QueryBuilderFilter extends AbstractQueryBuilder implements QueryBuilderFilterInterface, QueryBuilderOperatorInterface { |
||
28 | |||
29 | /** |
||
30 | * Decorator. |
||
31 | * |
||
32 | * @var QueryBuilderDecoratorInterface|null |
||
33 | */ |
||
34 | private $decorator; |
||
35 | |||
36 | /** |
||
37 | * Label. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | private $label; |
||
42 | |||
43 | /** |
||
44 | * Multiple. |
||
45 | * |
||
46 | * @var bool |
||
47 | */ |
||
48 | private $multiple; |
||
49 | |||
50 | /** |
||
51 | * Operators. |
||
52 | * |
||
53 | * @var array |
||
54 | */ |
||
55 | private $operators; |
||
56 | |||
57 | /** |
||
58 | * Validation. |
||
59 | * |
||
60 | * @var QueryBuilderValidationInterface|null |
||
61 | */ |
||
62 | private $validation; |
||
63 | |||
64 | /** |
||
65 | * Values. |
||
66 | * |
||
67 | * @var array|null |
||
68 | */ |
||
69 | private $values; |
||
70 | |||
71 | /** |
||
72 | * Constructor. |
||
73 | * |
||
74 | * @param string $id The id. |
||
75 | * @param string $type The type. |
||
76 | * @param array $operators The operators. |
||
77 | * @throws InvalidArgumentException Throws an invalid argument exception if an argument is invalid. |
||
78 | */ |
||
79 | public function __construct(string $id, string $type, array $operators) { |
||
87 | |||
88 | /** |
||
89 | * {@inheritDoc} |
||
90 | */ |
||
91 | public function getDecorator(): ?QueryBuilderDecoratorInterface { |
||
94 | |||
95 | /** |
||
96 | * {@inheritDoc} |
||
97 | */ |
||
98 | public function getLabel(): string { |
||
101 | |||
102 | /** |
||
103 | * {@inheritDoc} |
||
104 | */ |
||
105 | public function getMultiple(): bool { |
||
108 | |||
109 | /** |
||
110 | * {@inheritDoc} |
||
111 | */ |
||
112 | public function getOperators(): array { |
||
115 | |||
116 | /** |
||
117 | * {@inheritDoc} |
||
118 | */ |
||
119 | public function getValidation(): ?QueryBuilderValidationInterface { |
||
122 | |||
123 | /** |
||
124 | * {@inheritDoc} |
||
125 | */ |
||
126 | public function getValues(): ?array { |
||
129 | |||
130 | /** |
||
131 | * {@inheritDoc} |
||
132 | */ |
||
133 | public function jsonSerialize(): array { |
||
136 | |||
137 | /** |
||
138 | * Set the decorator. |
||
139 | * |
||
140 | * @param QueryBuilderDecoratorInterface|null $decorator The decorator. |
||
141 | * @return QueryBuilderFilterInterface Returns this filter. |
||
142 | */ |
||
143 | public function setDecorator(?QueryBuilderDecoratorInterface $decorator): QueryBuilderFilterInterface { |
||
147 | |||
148 | /** |
||
149 | * Set the label. |
||
150 | * |
||
151 | * @param string $label The label. |
||
152 | * @return QueryBuilderFilterInterface Returns this filter. |
||
153 | */ |
||
154 | public function setLabel(string $label): QueryBuilderFilterInterface { |
||
158 | |||
159 | /** |
||
160 | * Set the multiple. |
||
161 | * |
||
162 | * @param bool $multiple The multiple. |
||
163 | * @return QueryBuilderFilterInterface Returns this filter. |
||
164 | */ |
||
165 | public function setMultiple(bool $multiple): QueryBuilderFilterInterface { |
||
169 | |||
170 | /** |
||
171 | * Set the operators. |
||
172 | * |
||
173 | * @param array $operators The operators. |
||
174 | * @return QueryBuilderFilterInterface Returns this filter. |
||
175 | * @throws InvalidArgumentException Throws an invalid argument exception if an operator is invalid. |
||
176 | */ |
||
177 | public function setOperators(array $operators): QueryBuilderFilterInterface { |
||
187 | |||
188 | /** |
||
189 | * Set the validation. |
||
190 | * |
||
191 | * @param QueryBuilderValidationInterface|null $validation The validation. |
||
192 | * @return QueryBuilderFilterInterface Returns this filter. |
||
193 | */ |
||
194 | public function setValidation(?QueryBuilderValidationInterface $validation): QueryBuilderFilterInterface { |
||
198 | |||
199 | /** |
||
200 | * Set the values. |
||
201 | * |
||
202 | * @param array|null $values The values. |
||
203 | * @return QueryBuilderFilterInterface Returns this filter. |
||
204 | */ |
||
205 | public function setValues(?array $values): QueryBuilderFilterInterface { |
||
209 | } |
||
210 |