TreeWalker
in
Interface for walkers of DQL ASTs (abstract syntax trees).
Table of Contents
- __construct() : mixed
- Initializes TreeWalker with important information about the ASTs to be walked.
- getExecutor() : AbstractSqlExecutor
- Gets an executor that can be used to execute the result of this walker.
- getQueryComponents() : array<string, array<string, mixed>>
- Returns internal queryComponents array.
- setQueryComponent() : void
- Sets or overrides a query component for a given dql alias.
- walkAggregateExpression() : string
- Walks down an AggregateExpression AST node, thereby generating the appropriate SQL.
- walkArithmeticExpression() : string
- Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL.
- walkArithmeticFactor() : string
- Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL.
- walkArithmeticTerm() : string
- Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL.
- walkBetweenExpression() : string
- Walks down a BetweenExpression AST node, thereby generating the appropriate SQL.
- walkCollectionMemberExpression() : string
- Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL.
- walkComparisonExpression() : string
- Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL.
- walkConditionalExpression() : string
- Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL.
- walkConditionalFactor() : string
- Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL.
- walkConditionalPrimary() : string
- Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL.
- walkConditionalTerm() : string
- Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL.
- walkDeleteClause() : string
- Walks down a DeleteClause AST node, thereby generating the appropriate SQL.
- walkDeleteStatement() : string
- Walks down a DeleteStatement AST node, thereby generating the appropriate SQL.
- walkEmptyCollectionComparisonExpression() : string
- Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL.
- walkExistsExpression() : string
- Walks down an ExistsExpression AST node, thereby generating the appropriate SQL.
- walkFromClause() : string
- Walks down a FromClause AST node, thereby generating the appropriate SQL.
- walkFunction() : string
- Walks down a FunctionNode AST node, thereby generating the appropriate SQL.
- walkGroupByClause() : string
- Walks down a GroupByClause AST node, thereby generating the appropriate SQL.
- walkGroupByItem() : string
- Walks down a GroupByItem AST node, thereby generating the appropriate SQL.
- walkHavingClause() : string
- Walks down a HavingClause AST node, thereby generating the appropriate SQL.
- walkInExpression() : string
- Walks down an InExpression AST node, thereby generating the appropriate SQL.
- walkInputParameter() : string
- Walks down an InputParameter AST node, thereby generating the appropriate SQL.
- walkInstanceOfExpression() : string
- Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL.
- walkJoin() : string
- Walks down a Join AST node and creates the corresponding SQL.
- walkLikeExpression() : string
- Walks down a LikeExpression AST node, thereby generating the appropriate SQL.
- walkLiteral() : string
- Walks down a literal that represents an AST node, thereby generating the appropriate SQL.
- walkNullComparisonExpression() : string
- Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.
- walkOrderByClause() : string
- Walks down an OrderByClause AST node, thereby generating the appropriate SQL.
- walkOrderByItem() : string
- Walks down an OrderByItem AST node, thereby generating the appropriate SQL.
- walkPathExpression() : string
- Walks down a PathExpression AST node, thereby generating the appropriate SQL.
- walkQuantifiedExpression() : string
- Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL.
- walkResultVariable() : string
- Walks down a ResultVariable that represents an AST node, thereby generating the appropriate SQL.
- walkSelectClause() : string
- Walks down a SelectClause AST node, thereby generating the appropriate SQL.
- walkSelectExpression() : string
- Walks down a SelectExpression AST node and generates the corresponding SQL.
- walkSelectStatement() : string
- Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
- walkSimpleArithmeticExpression() : string
- Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.
- walkSimpleSelectClause() : string
- Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL.
- walkSimpleSelectExpression() : string
- Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL.
- walkStateFieldPathExpression() : string
- Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL.
- walkStringPrimary() : string
- Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL.
- walkSubselect() : string
- Walks down a Subselect AST node, thereby generating the appropriate SQL.
- walkSubselectFromClause() : string
- Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL.
- walkUpdateClause() : string
- Walks down an UpdateClause AST node, thereby generating the appropriate SQL.
- walkUpdateItem() : string
- Walks down an UpdateItem AST node, thereby generating the appropriate SQL.
- walkUpdateStatement() : string
- Walks down an UpdateStatement AST node, thereby generating the appropriate SQL.
- walkWhereClause() : string
- Walks down a WhereClause AST node, thereby generating the appropriate SQL.
Methods
__construct()
Initializes TreeWalker with important information about the ASTs to be walked.
public
__construct(AbstractQuery $query, ParserResult $parserResult, array<string|int, mixed> $queryComponents) : mixed
Parameters
- $query : AbstractQuery
-
The parsed Query.
- $parserResult : ParserResult
-
The result of the parsing process.
- $queryComponents : array<string|int, mixed>
-
The query components (symbol table).
Return values
mixed —getExecutor()
Gets an executor that can be used to execute the result of this walker.
public
getExecutor(DeleteStatement|UpdateStatement|SelectStatement $AST) : AbstractSqlExecutor
Parameters
Return values
AbstractSqlExecutor —getQueryComponents()
Returns internal queryComponents array.
public
getQueryComponents() : array<string, array<string, mixed>>
Tags
Return values
array<string, array<string, mixed>> —setQueryComponent()
Sets or overrides a query component for a given dql alias.
public
setQueryComponent(string $dqlAlias, array<string, mixed> $queryComponent) : void
Parameters
- $dqlAlias : string
-
The DQL alias.
- $queryComponent : array<string, mixed>
Return values
void —walkAggregateExpression()
Walks down an AggregateExpression AST node, thereby generating the appropriate SQL.
public
walkAggregateExpression(AggregateExpression $aggExpression) : string
Parameters
- $aggExpression : AggregateExpression
Return values
string —The SQL.
walkArithmeticExpression()
Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL.
public
walkArithmeticExpression(ArithmeticExpression $arithmeticExpr) : string
Parameters
- $arithmeticExpr : ArithmeticExpression
Return values
string —The SQL.
walkArithmeticFactor()
Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL.
public
walkArithmeticFactor(mixed $factor) : string
Parameters
- $factor : mixed
Return values
string —The SQL.
walkArithmeticTerm()
Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL.
public
walkArithmeticTerm(mixed $term) : string
Parameters
- $term : mixed
Return values
string —The SQL.
walkBetweenExpression()
Walks down a BetweenExpression AST node, thereby generating the appropriate SQL.
public
walkBetweenExpression(BetweenExpression $betweenExpr) : string
Parameters
- $betweenExpr : BetweenExpression
Return values
string —The SQL.
walkCollectionMemberExpression()
Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL.
public
walkCollectionMemberExpression(CollectionMemberExpression $collMemberExpr) : string
Parameters
- $collMemberExpr : CollectionMemberExpression
Return values
string —The SQL.
walkComparisonExpression()
Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL.
public
walkComparisonExpression(ComparisonExpression $compExpr) : string
Parameters
- $compExpr : ComparisonExpression
Return values
string —The SQL.
walkConditionalExpression()
Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL.
public
walkConditionalExpression(ConditionalExpression $condExpr) : string
Parameters
- $condExpr : ConditionalExpression
Return values
string —The SQL.
walkConditionalFactor()
Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL.
public
walkConditionalFactor(ConditionalFactor $factor) : string
Parameters
- $factor : ConditionalFactor
Return values
string —The SQL.
walkConditionalPrimary()
Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL.
public
walkConditionalPrimary(ConditionalPrimary $primary) : string
Parameters
- $primary : ConditionalPrimary
Return values
string —The SQL.
walkConditionalTerm()
Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL.
public
walkConditionalTerm(ConditionalTerm $condTerm) : string
Parameters
- $condTerm : ConditionalTerm
Return values
string —The SQL.
walkDeleteClause()
Walks down a DeleteClause AST node, thereby generating the appropriate SQL.
public
walkDeleteClause(DeleteClause $deleteClause) : string
Parameters
- $deleteClause : DeleteClause
Return values
string —The SQL.
walkDeleteStatement()
Walks down a DeleteStatement AST node, thereby generating the appropriate SQL.
public
walkDeleteStatement(DeleteStatement $AST) : string
Parameters
- $AST : DeleteStatement
Return values
string —The SQL.
walkEmptyCollectionComparisonExpression()
Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL.
public
walkEmptyCollectionComparisonExpression(EmptyCollectionComparisonExpression $emptyCollCompExpr) : string
Parameters
- $emptyCollCompExpr : EmptyCollectionComparisonExpression
Return values
string —The SQL.
walkExistsExpression()
Walks down an ExistsExpression AST node, thereby generating the appropriate SQL.
public
walkExistsExpression(ExistsExpression $existsExpr) : string
Parameters
- $existsExpr : ExistsExpression
Return values
string —The SQL.
walkFromClause()
Walks down a FromClause AST node, thereby generating the appropriate SQL.
public
walkFromClause(FromClause $fromClause) : string
Parameters
- $fromClause : FromClause
Return values
string —The SQL.
walkFunction()
Walks down a FunctionNode AST node, thereby generating the appropriate SQL.
public
walkFunction(FunctionNode $function) : string
Parameters
- $function : FunctionNode
Return values
string —The SQL.
walkGroupByClause()
Walks down a GroupByClause AST node, thereby generating the appropriate SQL.
public
walkGroupByClause(GroupByClause $groupByClause) : string
Parameters
- $groupByClause : GroupByClause
Return values
string —The SQL.
walkGroupByItem()
Walks down a GroupByItem AST node, thereby generating the appropriate SQL.
public
walkGroupByItem(PathExpression|string $groupByItem) : string
Parameters
- $groupByItem : PathExpression|string
Return values
string —The SQL.
walkHavingClause()
Walks down a HavingClause AST node, thereby generating the appropriate SQL.
public
walkHavingClause(HavingClause $havingClause) : string
Parameters
- $havingClause : HavingClause
Return values
string —The SQL.
walkInExpression()
Walks down an InExpression AST node, thereby generating the appropriate SQL.
public
walkInExpression(InExpression $inExpr) : string
Parameters
- $inExpr : InExpression
Return values
string —The SQL.
walkInputParameter()
Walks down an InputParameter AST node, thereby generating the appropriate SQL.
public
walkInputParameter(InputParameter $inputParam) : string
Parameters
- $inputParam : InputParameter
Return values
string —The SQL.
walkInstanceOfExpression()
Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL.
public
walkInstanceOfExpression(InstanceOfExpression $instanceOfExpr) : string
Parameters
- $instanceOfExpr : InstanceOfExpression
Return values
string —The SQL.
walkJoin()
Walks down a Join AST node and creates the corresponding SQL.
public
walkJoin(Join $join) : string
Parameters
- $join : Join
Return values
string —The SQL.
walkLikeExpression()
Walks down a LikeExpression AST node, thereby generating the appropriate SQL.
public
walkLikeExpression(LikeExpression $likeExpr) : string
Parameters
- $likeExpr : LikeExpression
Return values
string —The SQL.
walkLiteral()
Walks down a literal that represents an AST node, thereby generating the appropriate SQL.
public
walkLiteral(mixed $literal) : string
Parameters
- $literal : mixed
Return values
string —The SQL.
walkNullComparisonExpression()
Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.
public
walkNullComparisonExpression(NullComparisonExpression $nullCompExpr) : string
Parameters
- $nullCompExpr : NullComparisonExpression
Return values
string —The SQL.
walkOrderByClause()
Walks down an OrderByClause AST node, thereby generating the appropriate SQL.
public
walkOrderByClause(OrderByClause $orderByClause) : string
Parameters
- $orderByClause : OrderByClause
Return values
string —The SQL.
walkOrderByItem()
Walks down an OrderByItem AST node, thereby generating the appropriate SQL.
public
walkOrderByItem(OrderByItem $orderByItem) : string
Parameters
- $orderByItem : OrderByItem
Return values
string —The SQL.
walkPathExpression()
Walks down a PathExpression AST node, thereby generating the appropriate SQL.
public
walkPathExpression(mixed $pathExpr) : string
Parameters
- $pathExpr : mixed
Return values
string —The SQL.
walkQuantifiedExpression()
Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL.
public
walkQuantifiedExpression(QuantifiedExpression $qExpr) : string
Parameters
- $qExpr : QuantifiedExpression
Return values
string —The SQL.
walkResultVariable()
Walks down a ResultVariable that represents an AST node, thereby generating the appropriate SQL.
public
walkResultVariable(string $resultVariable) : string
Parameters
- $resultVariable : string
Return values
string —The SQL.
walkSelectClause()
Walks down a SelectClause AST node, thereby generating the appropriate SQL.
public
walkSelectClause(SelectClause $selectClause) : string
Parameters
- $selectClause : SelectClause
Return values
string —The SQL.
walkSelectExpression()
Walks down a SelectExpression AST node and generates the corresponding SQL.
public
walkSelectExpression(SelectExpression $selectExpression) : string
Parameters
- $selectExpression : SelectExpression
Return values
string —The SQL.
walkSelectStatement()
Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
public
walkSelectStatement(SelectStatement $AST) : string
Parameters
- $AST : SelectStatement
Return values
string —The SQL.
walkSimpleArithmeticExpression()
Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.
public
walkSimpleArithmeticExpression(SimpleArithmeticExpression $simpleArithmeticExpr) : string
Parameters
- $simpleArithmeticExpr : SimpleArithmeticExpression
Return values
string —The SQL.
walkSimpleSelectClause()
Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL.
public
walkSimpleSelectClause(SimpleSelectClause $simpleSelectClause) : string
Parameters
- $simpleSelectClause : SimpleSelectClause
Return values
string —The SQL.
walkSimpleSelectExpression()
Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL.
public
walkSimpleSelectExpression(SimpleSelectExpression $simpleSelectExpression) : string
Parameters
- $simpleSelectExpression : SimpleSelectExpression
Return values
string —The SQL.
walkStateFieldPathExpression()
Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL.
public
walkStateFieldPathExpression(PathExpression $stateFieldPathExpression) : string
Parameters
- $stateFieldPathExpression : PathExpression
Return values
string —The SQL.
walkStringPrimary()
Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL.
public
walkStringPrimary(mixed $stringPrimary) : string
Parameters
- $stringPrimary : mixed
Return values
string —The SQL.
walkSubselect()
Walks down a Subselect AST node, thereby generating the appropriate SQL.
public
walkSubselect(Subselect $subselect) : string
Parameters
- $subselect : Subselect
Return values
string —The SQL.
walkSubselectFromClause()
Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL.
public
walkSubselectFromClause(SubselectFromClause $subselectFromClause) : string
Parameters
- $subselectFromClause : SubselectFromClause
Return values
string —The SQL.
walkUpdateClause()
Walks down an UpdateClause AST node, thereby generating the appropriate SQL.
public
walkUpdateClause(UpdateClause $updateClause) : string
Parameters
- $updateClause : UpdateClause
Return values
string —The SQL.
walkUpdateItem()
Walks down an UpdateItem AST node, thereby generating the appropriate SQL.
public
walkUpdateItem(UpdateItem $updateItem) : string
Parameters
- $updateItem : UpdateItem
Return values
string —The SQL.
walkUpdateStatement()
Walks down an UpdateStatement AST node, thereby generating the appropriate SQL.
public
walkUpdateStatement(UpdateStatement $AST) : string
Parameters
- $AST : UpdateStatement
Return values
string —The SQL.
walkWhereClause()
Walks down a WhereClause AST node, thereby generating the appropriate SQL.
public
walkWhereClause(WhereClause $whereClause) : string
WhereClause or not, the appropriate discriminator sql is added.
Parameters
- $whereClause : WhereClause
Return values
string —The SQL.