Doctrine\ORM\Tools\Pagination\CountOutputWalker
Wrap the query in order to accurately count the root objects
Given a DQL like `SELECT u FROM User u` it will generate an SQL query like:
SELECT COUNT(*) (SELECT DISTINCT <id> FROM (<original SQL>))
Works with composite keys but cannot deal with queries that have multiple
root entities (e.g. `SELECT f, b from Foo, Bar`)
- Author: Sander Marechal <s.marechal@jejik.com>
Synopsis
class CountOutputWalker
extends SqlWalker
{
- // Inherited constants from SqlWalker
- const HINT_DISTINCT = 'doctrine.distinct';
- // members
- private AbstractPlatform $platform;
- private ResultSetMapping $rsm;
- private array $queryComponents;
- // methods
- public void __construct()
- public string walkSelectStatement()
- // Inherited methods from SqlWalker
- public void __construct()
- public Query. getQuery()
- public Connection getConnection()
- public EntityManager getEntityManager()
- public array getQueryComponent()
- public AbstractExecutor getExecutor()
- public string getSQLTableAlias()
- public string setSQLTableAlias()
- public string getSQLColumnAlias()
- public string walkSelectStatement()
- public string walkUpdateStatement()
- public string walkDeleteStatement()
- public string walkEntityIdentificationVariable()
- public string walkIdentificationVariable()
- public string walkPathExpression()
- public string walkSelectClause()
- public string walkFromClause()
- public string walkRangeVariableDeclaration()
- public string walkJoinAssociationDeclaration()
- public string walkFunction()
- public string walkOrderByClause()
- public string walkOrderByItem()
- public string walkHavingClause()
- public string walkJoin()
- public string walkCaseExpression()
- public string walkCoalesceExpression()
- public string walkNullIfExpression()
- public string walkGeneralCaseExpression()
- public string walkSimpleCaseExpression()
- public string walkSelectExpression()
- public string walkQuantifiedExpression()
- public string walkSubselect()
- public string walkSubselectFromClause()
- public string walkSimpleSelectClause()
- public string walkSimpleSelectExpression()
- public string walkAggregateExpression()
- public string walkGroupByClause()
- public string walkGroupByItem()
- public string walkDeleteClause()
- public string walkUpdateClause()
- public string walkUpdateItem()
- public string walkWhereClause()
- public string walkConditionalExpression()
- public string walkConditionalTerm()
- public string walkConditionalFactor()
- public string walkConditionalPrimary()
- public string walkExistsExpression()
- public string walkCollectionMemberExpression()
- public string walkEmptyCollectionComparisonExpression()
- public string walkNullComparisonExpression()
- public string walkInExpression()
- public string walkInstanceOfExpression()
- public string walkInParameter()
- public string walkLiteral()
- public string walkBetweenExpression()
- public string walkLikeExpression()
- public string walkStateFieldPathExpression()
- public string walkComparisonExpression()
- public string walkInputParameter()
- public string walkArithmeticExpression()
- public string walkSimpleArithmeticExpression()
- public string walkArithmeticTerm()
- public string walkArithmeticFactor()
- public string walkArithmeticPrimary()
- public string walkStringPrimary()
- public string walkResultVariable()
Hierarchy
Extends
Constants
Name | Value |
---|---|
HINT_DISTINCT | 'doctrine.distinct' |
Members
private
- $platform — Doctrine\ORM\Tools\Pagination\Doctrine\DBAL\Platforms\AbstractPlatform
- $queryComponents — array
- $rsm — Doctrine\ORM\Tools\Pagination\Doctrine\ORM\Query\ResultSetMapping
Methods
public
- __construct() — Constructor. Stores various parameters that are otherwise unavailable because Doctrine\ORM\Query\SqlWalker keeps everything private without accessors.
- walkSelectStatement() — Walks down a SelectStatement AST node, wrapping it in a COUNT (SELECT DISTINCT)
Inherited from Doctrine\ORM\Query\SqlWalker
public
- getConnection() — Gets the Connection used by the walker.
- getEntityManager() — Gets the EntityManager used by the walker.
- getExecutor() — Gets an executor that can be used to execute the result of this walker.
- getQuery() — Gets the Query instance used by the walker.
- getQueryComponent() — Gets the information about a single query component.
- getSQLColumnAlias() — Gets an SQL column alias for a column name.
- getSQLTableAlias() — Generates a unique, short SQL table alias.
- setSQLTableAlias() — Forces the SqlWalker to use a specific alias for a table name, rather than generating an alias on its own.
- walkAggregateExpression() — Walks down an AggregateExpression AST node, thereby generating the appropriate SQL.
- walkArithmeticExpression() — Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL.
- walkArithmeticFactor() — Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL.
- walkArithmeticPrimary() — Walks down an ArithmeticPrimary that represents an AST node, thereby generating the appropriate SQL.
- walkArithmeticTerm() — Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL.
- walkBetweenExpression() — Walks down a BetweenExpression AST node, thereby generating the appropriate SQL.
- walkCaseExpression() — Walks down a CaseExpression AST node and generates the corresponding SQL.
- walkCoalesceExpression() — Walks down a CoalesceExpression AST node and generates the corresponding SQL.
- walkCollectionMemberExpression() — Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL.
- walkComparisonExpression() — Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL.
- walkConditionalExpression() — Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL.
- walkConditionalFactor() — Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL.
- walkConditionalPrimary() — Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL.
- walkConditionalTerm() — Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL.
- walkDeleteClause() — Walks down a DeleteClause AST node, thereby generating the appropriate SQL.
- walkDeleteStatement() — Walks down a DeleteStatement AST node, thereby generating the appropriate SQL.
- walkEmptyCollectionComparisonExpression() — Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL.
- walkEntityIdentificationVariable() — Walks down an IdentificationVariable AST node, thereby generating the appropriate SQL.
- walkExistsExpression() — Walks down an ExistsExpression AST node, thereby generating the appropriate SQL.
- walkFromClause() — Walks down a FromClause AST node, thereby generating the appropriate SQL.
- walkFunction() — Walks down a FunctionNode AST node, thereby generating the appropriate SQL.
- walkGeneralCaseExpression() — Walks down a GeneralCaseExpression AST node and generates the corresponding SQL.
- walkGroupByClause() — Walks down a GroupByClause AST node, thereby generating the appropriate SQL.
- walkGroupByItem() — Walks down a GroupByItem AST node, thereby generating the appropriate SQL.
- walkHavingClause() — Walks down a HavingClause AST node, thereby generating the appropriate SQL.
- walkIdentificationVariable() — Walks down an IdentificationVariable (no AST node associated), thereby generating the SQL.
- walkInExpression() — Walks down an InExpression AST node, thereby generating the appropriate SQL.
- walkInParameter() — Walks down an InParameter AST node, thereby generating the appropriate SQL.
- walkInputParameter() — Walks down an InputParameter AST node, thereby generating the appropriate SQL.
- walkInstanceOfExpression() — Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL.
- walkJoin() — Walks down a Join AST node and creates the corresponding SQL.
- walkJoinAssociationDeclaration() — Walks down a JoinAssociationDeclaration AST node, thereby generating the appropriate SQL.
- walkLikeExpression() — Walks down a LikeExpression AST node, thereby generating the appropriate SQL.
- walkLiteral() — Walks down a literal that represents an AST node, thereby generating the appropriate SQL.
- walkNullComparisonExpression() — Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.
- walkNullIfExpression() — Walks down a NullIfExpression AST node and generates the corresponding SQL.
- walkOrderByClause() — Walks down an OrderByClause AST node, thereby generating the appropriate SQL.
- walkOrderByItem() — Walks down an OrderByItem AST node, thereby generating the appropriate SQL.
- walkPathExpression() — Walks down a PathExpression AST node, thereby generating the appropriate SQL.
- walkQuantifiedExpression() — Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL.
- walkRangeVariableDeclaration() — Walks down a RangeVariableDeclaration AST node, thereby generating the appropriate SQL.
- walkResultVariable() — Walks down a ResultVriable that represents an AST node, thereby generating the appropriate SQL.
- walkSelectClause() — Walks down a SelectClause AST node, thereby generating the appropriate SQL.
- walkSelectExpression() — Walks down a SelectExpression AST node and generates the corresponding SQL.
- walkSelectStatement() — Walks down a SelectStatement AST node, thereby generating the appropriate SQL.
- walkSimpleArithmeticExpression() — Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.
- walkSimpleCaseExpression() — Walks down a SimpleCaseExpression AST node and generates the corresponding SQL.
- walkSimpleSelectClause() — Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL.
- walkSimpleSelectExpression() — Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL.
- walkStateFieldPathExpression() — Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL.
- walkStringPrimary() — Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL.
- walkSubselect() — Walks down a Subselect AST node, thereby generating the appropriate SQL.
- walkSubselectFromClause() — Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL.
- walkUpdateClause() — Walks down an UpdateClause AST node, thereby generating the appropriate SQL.
- walkUpdateItem() — Walks down an UpdateItem AST node, thereby generating the appropriate SQL.
- walkUpdateStatement() — Walks down an UpdateStatement AST node, thereby generating the appropriate SQL.
- walkWhereClause() — Walks down a WhereClause AST node, thereby generating the appropriate SQL.