3 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 * This software consists of voluntary contributions made by many individuals
16 * and is licensed under the MIT license. For more information, see
17 * <http://www.doctrine-project.org>.
20 namespace Doctrine\ORM\Query;
23 * Interface for walkers of DQL ASTs (abstract syntax trees).
25 * @author Roman Borschel <roman@code-factory.org>
31 * Initializes TreeWalker with important information about the ASTs to be walked
33 * @param Query $query The parsed Query.
34 * @param ParserResult $parserResult The result of the parsing process.
35 * @param array $queryComponents Query components (symbol table)
37 public function __construct($query, $parserResult, array $queryComponents);
40 * Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
42 * @return string The SQL.
44 function walkSelectStatement(AST\SelectStatement $AST);
47 * Walks down a SelectClause AST node, thereby generating the appropriate SQL.
49 * @return string The SQL.
51 function walkSelectClause($selectClause);
54 * Walks down a FromClause AST node, thereby generating the appropriate SQL.
56 * @return string The SQL.
58 function walkFromClause($fromClause);
61 * Walks down a FunctionNode AST node, thereby generating the appropriate SQL.
63 * @return string The SQL.
65 function walkFunction($function);
68 * Walks down an OrderByClause AST node, thereby generating the appropriate SQL.
70 * @param OrderByClause
71 * @return string The SQL.
73 function walkOrderByClause($orderByClause);
76 * Walks down an OrderByItem AST node, thereby generating the appropriate SQL.
79 * @return string The SQL.
81 function walkOrderByItem($orderByItem);
84 * Walks down a HavingClause AST node, thereby generating the appropriate SQL.
87 * @return string The SQL.
89 function walkHavingClause($havingClause);
92 * Walks down a Join AST node and creates the corresponding SQL.
94 * @param Join $joinVarDecl
95 * @return string The SQL.
97 function walkJoin($join);
100 * Walks down a SelectExpression AST node and generates the corresponding SQL.
102 * @param SelectExpression $selectExpression
103 * @return string The SQL.
105 function walkSelectExpression($selectExpression);
108 * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL.
110 * @param QuantifiedExpression
111 * @return string The SQL.
113 function walkQuantifiedExpression($qExpr);
116 * Walks down a Subselect AST node, thereby generating the appropriate SQL.
119 * @return string The SQL.
121 function walkSubselect($subselect);
124 * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL.
126 * @param SubselectFromClause
127 * @return string The SQL.
129 function walkSubselectFromClause($subselectFromClause);
132 * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL.
134 * @param SimpleSelectClause
135 * @return string The SQL.
137 function walkSimpleSelectClause($simpleSelectClause);
140 * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL.
142 * @param SimpleSelectExpression
143 * @return string The SQL.
145 function walkSimpleSelectExpression($simpleSelectExpression);
148 * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL.
150 * @param AggregateExpression
151 * @return string The SQL.
153 function walkAggregateExpression($aggExpression);
156 * Walks down a GroupByClause AST node, thereby generating the appropriate SQL.
158 * @param GroupByClause
159 * @return string The SQL.
161 function walkGroupByClause($groupByClause);
164 * Walks down a GroupByItem AST node, thereby generating the appropriate SQL.
167 * @return string The SQL.
169 function walkGroupByItem($groupByItem);
172 * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL.
174 * @param UpdateStatement
175 * @return string The SQL.
177 function walkUpdateStatement(AST\UpdateStatement $AST);
180 * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL.
182 * @param DeleteStatement
183 * @return string The SQL.
185 function walkDeleteStatement(AST\DeleteStatement $AST);
188 * Walks down a DeleteClause AST node, thereby generating the appropriate SQL.
190 * @param DeleteClause
191 * @return string The SQL.
193 function walkDeleteClause(AST\DeleteClause $deleteClause);
196 * Walks down an UpdateClause AST node, thereby generating the appropriate SQL.
198 * @param UpdateClause
199 * @return string The SQL.
201 function walkUpdateClause($updateClause);
204 * Walks down an UpdateItem AST node, thereby generating the appropriate SQL.
207 * @return string The SQL.
209 function walkUpdateItem($updateItem);
212 * Walks down a WhereClause AST node, thereby generating the appropriate SQL.
215 * @return string The SQL.
217 function walkWhereClause($whereClause);
220 * Walks down a ConditionalExpression AST node, thereby generating the appropriate SQL.
222 * @param ConditionalExpression
223 * @return string The SQL.
225 function walkConditionalExpression($condExpr);
228 * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL.
230 * @param ConditionalTerm
231 * @return string The SQL.
233 function walkConditionalTerm($condTerm);
236 * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL.
238 * @param ConditionalFactor
239 * @return string The SQL.
241 function walkConditionalFactor($factor);
244 * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL.
246 * @param ConditionalPrimary
247 * @return string The SQL.
249 function walkConditionalPrimary($primary);
252 * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL.
254 * @param ExistsExpression
255 * @return string The SQL.
257 function walkExistsExpression($existsExpr);
260 * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL.
262 * @param CollectionMemberExpression
263 * @return string The SQL.
265 function walkCollectionMemberExpression($collMemberExpr);
268 * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL.
270 * @param EmptyCollectionComparisonExpression
271 * @return string The SQL.
273 function walkEmptyCollectionComparisonExpression($emptyCollCompExpr);
276 * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.
278 * @param NullComparisonExpression
279 * @return string The SQL.
281 function walkNullComparisonExpression($nullCompExpr);
284 * Walks down an InExpression AST node, thereby generating the appropriate SQL.
286 * @param InExpression
287 * @return string The SQL.
289 function walkInExpression($inExpr);
292 * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL.
294 * @param InstanceOfExpression
295 * @return string The SQL.
297 function walkInstanceOfExpression($instanceOfExpr);
300 * Walks down a literal that represents an AST node, thereby generating the appropriate SQL.
303 * @return string The SQL.
305 function walkLiteral($literal);
308 * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL.
310 * @param BetweenExpression
311 * @return string The SQL.
313 function walkBetweenExpression($betweenExpr);
316 * Walks down a LikeExpression AST node, thereby generating the appropriate SQL.
318 * @param LikeExpression
319 * @return string The SQL.
321 function walkLikeExpression($likeExpr);
324 * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL.
326 * @param StateFieldPathExpression
327 * @return string The SQL.
329 function walkStateFieldPathExpression($stateFieldPathExpression);
332 * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL.
334 * @param ComparisonExpression
335 * @return string The SQL.
337 function walkComparisonExpression($compExpr);
340 * Walks down an InputParameter AST node, thereby generating the appropriate SQL.
342 * @param InputParameter
343 * @return string The SQL.
345 function walkInputParameter($inputParam);
348 * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL.
350 * @param ArithmeticExpression
351 * @return string The SQL.
353 function walkArithmeticExpression($arithmeticExpr);
356 * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL.
359 * @return string The SQL.
361 function walkArithmeticTerm($term);
364 * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL.
367 * @return string The SQL.
369 function walkStringPrimary($stringPrimary);
372 * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL.
375 * @return string The SQL.
377 function walkArithmeticFactor($factor);
380 * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.
382 * @param SimpleArithmeticExpression
383 * @return string The SQL.
385 function walkSimpleArithmeticExpression($simpleArithmeticExpr);
388 * Walks down an PathExpression AST node, thereby generating the appropriate SQL.
391 * @return string The SQL.
393 function walkPathExpression($pathExpr);
396 * Walks down an ResultVariable AST node, thereby generating the appropriate SQL.
398 * @param string $resultVariable
399 * @return string The SQL.
401 function walkResultVariable($resultVariable);
404 * Gets an executor that can be used to execute the result of this walker.
406 * @return AbstractExecutor
408 function getExecutor($AST);