class LimitSubqueryOutputWalker extends SqlWalker

Wraps the query in order to select root entity IDs for pagination.

Given a DQL like SELECT u FROM User u it will generate an SQL query like: SELECT DISTINCT FROM () LIMIT x OFFSET y

Works with composite keys but cannot deal with queries that have multiple root entities (e.g. SELECT f, b from Foo, Bar)

Methods

__construct(Query $query, ParserResult $parserResult, array $queryComponents)

Constructor.

string
walkSelectStatement(SelectStatement $AST)

Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.

string
walkSelectStatementWithRowNumber(SelectStatement $AST)

Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.

string
walkSelectStatementWithoutRowNumber(SelectStatement $AST, bool $addMissingItemsFromOrderByToSelect = true)

Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.

array
getOrderByPathExpressions()

getter for $orderByPathExpressions

walkPathExpression($pathExpr)

{@inheritdoc}

walkSubSelect($subselect)

{@inheritdoc}

Details

at line 108
__construct(Query $query, ParserResult $parserResult, array $queryComponents)

Constructor.

Stores various parameters that are otherwise unavailable because Doctrine\ORM\Query\SqlWalker keeps everything private without accessors.

Parameters

Query $query
ParserResult $parserResult
array $queryComponents

at line 179
string walkSelectStatement(SelectStatement $AST)

Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.

Parameters

SelectStatement $AST

Return Value

string

Exceptions

RuntimeException

at line 197
string walkSelectStatementWithRowNumber(SelectStatement $AST)

Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.

This method is for use with platforms which support ROW_NUMBER.

Parameters

SelectStatement $AST

Return Value

string

Exceptions

RuntimeException

at line 256
string walkSelectStatementWithoutRowNumber(SelectStatement $AST, bool $addMissingItemsFromOrderByToSelect = true)

Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.

This method is for platforms which DO NOT support ROW_NUMBER.

Parameters

SelectStatement $AST
bool $addMissingItemsFromOrderByToSelect

Return Value

string

Exceptions

RuntimeException

at line 486
array getOrderByPathExpressions()

getter for $orderByPathExpressions

Return Value

array

at line 583
walkPathExpression($pathExpr)

{@inheritdoc}

Parameters

$pathExpr

at line 595
walkSubSelect($subselect)

{@inheritdoc}

Parameters

$subselect