1 | <?php |
||
50 | class SpecificationVisitor extends Visitor |
||
51 | { |
||
52 | use VisitorTrait; |
||
53 | |||
54 | /** |
||
55 | * @param QueryBuilder $queryBuilder |
||
56 | */ |
||
57 | public function __construct(QueryBuilder $queryBuilder) |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function visitAndSpecification(AndSpecification $specification) |
||
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | public function visitOrSpecification(OrSpecification $specification) |
||
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | public function visitNotSpecification(NotSpecification $specification) |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function visitSelector(Selector $selector) |
||
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | public function visitValue(Value $specification) |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function visitKey(Key $specification) |
||
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | public function visitProperty(Property $specification) |
||
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | public function visitMethod(Method $specification) |
||
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | public function visitThis(This $specification) |
||
149 | |||
150 | /** |
||
151 | * {@inheritdoc} |
||
152 | */ |
||
153 | public function visitCallback(Callback $specification) |
||
157 | |||
158 | /** |
||
159 | * {@inheritdoc} |
||
160 | */ |
||
161 | public function visitComposite(Composite $specification) |
||
165 | |||
166 | /** |
||
167 | * {@inheritdoc} |
||
168 | */ |
||
169 | public function visitCount(Count $specification) |
||
173 | |||
174 | /** |
||
175 | * {@inheritdoc} |
||
176 | */ |
||
177 | public function visitGreaterThan(GreaterThan $specification) |
||
181 | |||
182 | /** |
||
183 | * {@inheritdoc} |
||
184 | */ |
||
185 | public function visitGreaterThanEqual(GreaterThanEqual $specification) |
||
189 | |||
190 | /** |
||
191 | * {@inheritdoc} |
||
192 | */ |
||
193 | public function visitLessThan(LessThan $specification) |
||
197 | |||
198 | /** |
||
199 | * {@inheritdoc} |
||
200 | */ |
||
201 | public function visitLessThanEqual(LessThanEqual $specification) |
||
205 | |||
206 | /** |
||
207 | * {@inheritdoc} |
||
208 | */ |
||
209 | public function visitEqual(Equal $specification) |
||
213 | |||
214 | /** |
||
215 | * {@inheritdoc} |
||
216 | */ |
||
217 | public function visitNotEqual(NotEqual $specification) |
||
221 | |||
222 | /** |
||
223 | * {@inheritdoc} |
||
224 | */ |
||
225 | public function visitSame(Same $specification) |
||
229 | |||
230 | /** |
||
231 | * {@inheritdoc} |
||
232 | */ |
||
233 | public function visitNotSame(NotSame $specification) |
||
237 | |||
238 | /** |
||
239 | * {@inheritdoc} |
||
240 | */ |
||
241 | public function visitAll(All $specification) |
||
250 | |||
251 | /** |
||
252 | * {@inheritdoc} |
||
253 | */ |
||
254 | public function visitAtLeast(AtLeast $specification) |
||
264 | |||
265 | /** |
||
266 | * @param QueryBuilder $queryBuilder1 |
||
267 | * @param QueryBuilder $queryBuilder2 |
||
268 | * |
||
269 | * @return bool |
||
270 | */ |
||
271 | protected function hasSameOperator(QueryBuilder $queryBuilder1, QueryBuilder $queryBuilder2) |
||
281 | |||
282 | /** |
||
283 | * @param BinaryConstraintOperator $operator |
||
284 | * @param Delegate $addOperator |
||
285 | */ |
||
286 | protected function visitRelationalOperator(BinaryConstraintOperator $operator, Delegate $addOperator) |
||
290 | |||
291 | /** |
||
292 | * @param BinaryConstraintOperator $operator |
||
293 | */ |
||
294 | protected function visitEqualityOperator(BinaryConstraintOperator $operator) |
||
307 | |||
308 | /** |
||
309 | * @param BinaryConstraintOperator $operator |
||
310 | */ |
||
311 | protected function visitNotEqualityOperator(BinaryConstraintOperator $operator) |
||
315 | |||
316 | /** |
||
317 | * @param SelectorInterface $selector |
||
318 | * @param SelectorInterface $value |
||
319 | * @param Delegate $addOperator |
||
320 | */ |
||
321 | private function addFieldValueOperator( |
||
339 | |||
340 | /** |
||
341 | * @param Field $field |
||
342 | */ |
||
343 | protected function visitField(Field $field) |
||
347 | |||
348 | /** |
||
349 | * @param SpecificationInterface $specification |
||
350 | * |
||
351 | * @return QueryBuilder |
||
352 | */ |
||
353 | protected function queryBuilderFromSpecification(SpecificationInterface $specification) |
||
357 | } |
||
358 |