CountWalker
extends TreeWalkerAdapter
in package
Replaces the selectClause of the AST with a COUNT statement.
Table of Contents
- HINT_DISTINCT = 'doctrine_paginator.distinct'
- Distinct mode hint name.
- $_parserResult : ParserResult
- The ParserResult of the original query that was produced by the Parser.
- $_query : AbstractQuery
- The original Query.
- $_queryComponents : mixed
- The query components of the original query (the "symbol table") that was produced by the Parser.
- __construct() : mixed
- Initializes TreeWalker with important information about the ASTs to be walked.
- getExecutor() : void
- 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() : void
- Walks down an AggregateExpression AST node, thereby generating the appropriate SQL.
- walkArithmeticExpression() : void
- Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL.
- walkArithmeticFactor() : void
- Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL.
- walkArithmeticTerm() : void
- Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL.
- walkBetweenExpression() : void
- Walks down a BetweenExpression AST node, thereby generating the appropriate SQL.
- walkCollectionMemberExpression() : void
- Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL.
- walkComparisonExpression() : void
- Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL.
- walkConditionalExpression() : void
- Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL.
- walkConditionalFactor() : void
- Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL.
- walkConditionalPrimary() : void
- Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL.
- walkConditionalTerm() : void
- Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL.
- walkDeleteClause() : void
- Walks down a DeleteClause AST node, thereby generating the appropriate SQL.
- walkDeleteStatement() : void
- Walks down a DeleteStatement AST node, thereby generating the appropriate SQL.
- walkEmptyCollectionComparisonExpression() : void
- Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL.
- walkExistsExpression() : void
- Walks down an ExistsExpression AST node, thereby generating the appropriate SQL.
- walkFromClause() : void
- Walks down a FromClause AST node, thereby generating the appropriate SQL.
- walkFunction() : void
- Walks down a FunctionNode AST node, thereby generating the appropriate SQL.
- walkGroupByClause() : void
- Walks down a GroupByClause AST node, thereby generating the appropriate SQL.
- walkGroupByItem() : void
- Walks down a GroupByItem AST node, thereby generating the appropriate SQL.
- walkHavingClause() : void
- Walks down a HavingClause AST node, thereby generating the appropriate SQL.
- walkInExpression() : void
- Walks down an InExpression AST node, thereby generating the appropriate SQL.
- walkInputParameter() : void
- Walks down an InputParameter AST node, thereby generating the appropriate SQL.
- walkInstanceOfExpression() : void
- Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL.
- walkJoin() : void
- Walks down a Join AST node and creates the corresponding SQL.
- walkLikeExpression() : void
- Walks down a LikeExpression AST node, thereby generating the appropriate SQL.
- walkLiteral() : void
- Walks down a literal that represents an AST node, thereby generating the appropriate SQL.
- walkNullComparisonExpression() : void
- Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.
- walkOrderByClause() : void
- Walks down an OrderByClause AST node, thereby generating the appropriate SQL.
- walkOrderByItem() : void
- Walks down an OrderByItem AST node, thereby generating the appropriate SQL.
- walkPathExpression() : void
- Walks down a PathExpression AST node, thereby generating the appropriate SQL.
- walkQuantifiedExpression() : void
- Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL.
- walkResultVariable() : void
- Walks down a ResultVariable that represents an AST node, thereby generating the appropriate SQL.
- walkSelectClause() : void
- Walks down a SelectClause AST node, thereby generating the appropriate SQL.
- walkSelectExpression() : void
- Walks down a SelectExpression AST node and generates the corresponding SQL.
- walkSelectStatement() : void
- Walks down a SelectStatement AST node, modifying it to retrieve a COUNT.
- walkSimpleArithmeticExpression() : void
- Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.
- walkSimpleSelectClause() : void
- Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL.
- walkSimpleSelectExpression() : void
- Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL.
- walkStateFieldPathExpression() : void
- Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL.
- walkStringPrimary() : void
- Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL.
- walkSubselect() : void
- Walks down a Subselect AST node, thereby generating the appropriate SQL.
- walkSubselectFromClause() : void
- Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL.
- walkUpdateClause() : void
- Walks down an UpdateClause AST node, thereby generating the appropriate SQL.
- walkUpdateItem() : void
- Walks down an UpdateItem AST node, thereby generating the appropriate SQL.
- walkUpdateStatement() : void
- Walks down an UpdateStatement AST node, thereby generating the appropriate SQL.
- walkWhereClause() : void
- Walks down a WhereClause AST node, thereby generating the appropriate SQL.
- _getParserResult() : ParserResult
- Retrieves the ParserResult.
- _getQuery() : AbstractQuery
- Retrieves the Query Instance responsible for the current walkers execution.
- _getQueryComponents() : mixed
- {@inheritDoc}
Constants
HINT_DISTINCT
Distinct mode hint name.
public
mixed
HINT_DISTINCT
= 'doctrine_paginator.distinct'
Properties
$_parserResult
The ParserResult of the original query that was produced by the Parser.
private
ParserResult
$_parserResult
$_query
The original Query.
private
AbstractQuery
$_query
$_queryComponents
The query components of the original query (the "symbol table") that was produced by the Parser.
private
mixed
$_queryComponents
Tags
Methods
__construct()
Initializes TreeWalker with important information about the ASTs to be walked.
public
__construct(mixed $query, mixed $parserResult, array<string|int, mixed> $queryComponents) : mixed
Parameters
- $query : mixed
-
The parsed Query.
- $parserResult : mixed
-
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(mixed $AST) : void
Parameters
- $AST : mixed
Return values
void —getQueryComponents()
Returns internal queryComponents array.
public
getQueryComponents() : array<string, array<string, mixed>>
Return values
array<string, array<string, mixed>> —setQueryComponent()
Sets or overrides a query component for a given dql alias.
public
setQueryComponent(mixed $dqlAlias, array<string|int, mixed> $queryComponent) : void
Parameters
- $dqlAlias : mixed
-
The DQL alias.
- $queryComponent : array<string|int, mixed>
Return values
void —walkAggregateExpression()
Walks down an AggregateExpression AST node, thereby generating the appropriate SQL.
public
walkAggregateExpression(mixed $aggExpression) : void
Parameters
- $aggExpression : mixed
Return values
void —walkArithmeticExpression()
Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL.
public
walkArithmeticExpression(mixed $arithmeticExpr) : void
Parameters
- $arithmeticExpr : mixed
Return values
void —walkArithmeticFactor()
Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL.
public
walkArithmeticFactor(mixed $factor) : void
Parameters
- $factor : mixed
Return values
void —walkArithmeticTerm()
Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL.
public
walkArithmeticTerm(mixed $term) : void
Parameters
- $term : mixed
Return values
void —walkBetweenExpression()
Walks down a BetweenExpression AST node, thereby generating the appropriate SQL.
public
walkBetweenExpression(mixed $betweenExpr) : void
Parameters
- $betweenExpr : mixed
Return values
void —walkCollectionMemberExpression()
Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL.
public
walkCollectionMemberExpression(mixed $collMemberExpr) : void
Parameters
- $collMemberExpr : mixed
Return values
void —walkComparisonExpression()
Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL.
public
walkComparisonExpression(mixed $compExpr) : void
Parameters
- $compExpr : mixed
Return values
void —walkConditionalExpression()
Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL.
public
walkConditionalExpression(mixed $condExpr) : void
Parameters
- $condExpr : mixed
Return values
void —walkConditionalFactor()
Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL.
public
walkConditionalFactor(mixed $factor) : void
Parameters
- $factor : mixed
Return values
void —walkConditionalPrimary()
Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL.
public
walkConditionalPrimary(mixed $primary) : void
Parameters
- $primary : mixed
Return values
void —walkConditionalTerm()
Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL.
public
walkConditionalTerm(mixed $condTerm) : void
Parameters
- $condTerm : mixed
Return values
void —walkDeleteClause()
Walks down a DeleteClause AST node, thereby generating the appropriate SQL.
public
walkDeleteClause(DeleteClause $deleteClause) : void
Parameters
- $deleteClause : DeleteClause
Return values
void —walkDeleteStatement()
Walks down a DeleteStatement AST node, thereby generating the appropriate SQL.
public
walkDeleteStatement(DeleteStatement $AST) : void
Parameters
- $AST : DeleteStatement
Return values
void —walkEmptyCollectionComparisonExpression()
Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL.
public
walkEmptyCollectionComparisonExpression(mixed $emptyCollCompExpr) : void
Parameters
- $emptyCollCompExpr : mixed
Return values
void —walkExistsExpression()
Walks down an ExistsExpression AST node, thereby generating the appropriate SQL.
public
walkExistsExpression(mixed $existsExpr) : void
Parameters
- $existsExpr : mixed
Return values
void —walkFromClause()
Walks down a FromClause AST node, thereby generating the appropriate SQL.
public
walkFromClause(mixed $fromClause) : void
Parameters
- $fromClause : mixed
Return values
void —walkFunction()
Walks down a FunctionNode AST node, thereby generating the appropriate SQL.
public
walkFunction(mixed $function) : void
Parameters
- $function : mixed
Return values
void —walkGroupByClause()
Walks down a GroupByClause AST node, thereby generating the appropriate SQL.
public
walkGroupByClause(mixed $groupByClause) : void
Parameters
- $groupByClause : mixed
Return values
void —walkGroupByItem()
Walks down a GroupByItem AST node, thereby generating the appropriate SQL.
public
walkGroupByItem(mixed $groupByItem) : void
Parameters
- $groupByItem : mixed
Return values
void —walkHavingClause()
Walks down a HavingClause AST node, thereby generating the appropriate SQL.
public
walkHavingClause(mixed $havingClause) : void
Parameters
- $havingClause : mixed
Return values
void —walkInExpression()
Walks down an InExpression AST node, thereby generating the appropriate SQL.
public
walkInExpression(mixed $inExpr) : void
Parameters
- $inExpr : mixed
Return values
void —walkInputParameter()
Walks down an InputParameter AST node, thereby generating the appropriate SQL.
public
walkInputParameter(mixed $inputParam) : void
Parameters
- $inputParam : mixed
Return values
void —walkInstanceOfExpression()
Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL.
public
walkInstanceOfExpression(mixed $instanceOfExpr) : void
Parameters
- $instanceOfExpr : mixed
Return values
void —walkJoin()
Walks down a Join AST node and creates the corresponding SQL.
public
walkJoin(mixed $join) : void
Parameters
- $join : mixed
Return values
void —walkLikeExpression()
Walks down a LikeExpression AST node, thereby generating the appropriate SQL.
public
walkLikeExpression(mixed $likeExpr) : void
Parameters
- $likeExpr : mixed
Return values
void —walkLiteral()
Walks down a literal that represents an AST node, thereby generating the appropriate SQL.
public
walkLiteral(mixed $literal) : void
Parameters
- $literal : mixed
Return values
void —walkNullComparisonExpression()
Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.
public
walkNullComparisonExpression(mixed $nullCompExpr) : void
Parameters
- $nullCompExpr : mixed
Return values
void —walkOrderByClause()
Walks down an OrderByClause AST node, thereby generating the appropriate SQL.
public
walkOrderByClause(mixed $orderByClause) : void
Parameters
- $orderByClause : mixed
Return values
void —walkOrderByItem()
Walks down an OrderByItem AST node, thereby generating the appropriate SQL.
public
walkOrderByItem(mixed $orderByItem) : void
Parameters
- $orderByItem : mixed
Return values
void —walkPathExpression()
Walks down a PathExpression AST node, thereby generating the appropriate SQL.
public
walkPathExpression(mixed $pathExpr) : void
Parameters
- $pathExpr : mixed
Return values
void —walkQuantifiedExpression()
Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL.
public
walkQuantifiedExpression(mixed $qExpr) : void
Parameters
- $qExpr : mixed
Return values
void —walkResultVariable()
Walks down a ResultVariable that represents an AST node, thereby generating the appropriate SQL.
public
walkResultVariable(mixed $resultVariable) : void
Parameters
- $resultVariable : mixed
Return values
void —walkSelectClause()
Walks down a SelectClause AST node, thereby generating the appropriate SQL.
public
walkSelectClause(mixed $selectClause) : void
Parameters
- $selectClause : mixed
Return values
void —walkSelectExpression()
Walks down a SelectExpression AST node and generates the corresponding SQL.
public
walkSelectExpression(mixed $selectExpression) : void
Parameters
- $selectExpression : mixed
Return values
void —walkSelectStatement()
Walks down a SelectStatement AST node, modifying it to retrieve a COUNT.
public
walkSelectStatement(SelectStatement $AST) : void
Parameters
- $AST : SelectStatement
Tags
Return values
void —walkSimpleArithmeticExpression()
Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.
public
walkSimpleArithmeticExpression(mixed $simpleArithmeticExpr) : void
Parameters
- $simpleArithmeticExpr : mixed
Return values
void —walkSimpleSelectClause()
Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL.
public
walkSimpleSelectClause(mixed $simpleSelectClause) : void
Parameters
- $simpleSelectClause : mixed
Return values
void —walkSimpleSelectExpression()
Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL.
public
walkSimpleSelectExpression(mixed $simpleSelectExpression) : void
Parameters
- $simpleSelectExpression : mixed
Return values
void —walkStateFieldPathExpression()
Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL.
public
walkStateFieldPathExpression(mixed $stateFieldPathExpression) : void
Parameters
- $stateFieldPathExpression : mixed
Return values
void —walkStringPrimary()
Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL.
public
walkStringPrimary(mixed $stringPrimary) : void
Parameters
- $stringPrimary : mixed
Return values
void —walkSubselect()
Walks down a Subselect AST node, thereby generating the appropriate SQL.
public
walkSubselect(mixed $subselect) : void
Parameters
- $subselect : mixed
Return values
void —walkSubselectFromClause()
Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL.
public
walkSubselectFromClause(mixed $subselectFromClause) : void
Parameters
- $subselectFromClause : mixed
Return values
void —walkUpdateClause()
Walks down an UpdateClause AST node, thereby generating the appropriate SQL.
public
walkUpdateClause(mixed $updateClause) : void
Parameters
- $updateClause : mixed
Return values
void —walkUpdateItem()
Walks down an UpdateItem AST node, thereby generating the appropriate SQL.
public
walkUpdateItem(mixed $updateItem) : void
Parameters
- $updateItem : mixed
Return values
void —walkUpdateStatement()
Walks down an UpdateStatement AST node, thereby generating the appropriate SQL.
public
walkUpdateStatement(UpdateStatement $AST) : void
Parameters
- $AST : UpdateStatement
Return values
void —walkWhereClause()
Walks down a WhereClause AST node, thereby generating the appropriate SQL.
public
walkWhereClause(mixed $whereClause) : void
Parameters
- $whereClause : mixed
Return values
void —_getParserResult()
Retrieves the ParserResult.
protected
_getParserResult() : ParserResult
Return values
ParserResult —_getQuery()
Retrieves the Query Instance responsible for the current walkers execution.
protected
_getQuery() : AbstractQuery
Return values
AbstractQuery —_getQueryComponents()
{@inheritDoc}
protected
_getQueryComponents() : mixed