mediatekformation

LimitSubqueryOutputWalker extends SqlWalker
in package

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 (<original SQL>) 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)

Table of Contents

HINT_DISTINCT  = 'doctrine.distinct'
HINT_PARTIAL  = 'doctrine.partial'
Used to mark a query as containing a PARTIAL expression, which needs to be known by SLC.
ORDER_BY_PATH_EXPRESSION  = '/(?<![a-z0-9_])%s\\.%s(?![a-z0-9_])/i'
$aliasCounter  : int
Counter for generating unique column aliases.
$conn  : Connection
$em  : EntityManagerInterface
$firstResult  : int
$inSubSelect  : bool
$maxResults  : int
$newObjectCounter  : int
Counter for generating indexes.
$orderByPathExpressions  : array<string|int, mixed>
$orderedColumnsMap  : array<string, string>
Map from Table-Alias + Column-Name to OrderBy-Direction.
$parserResult  : ParserResult
$platform  : AbstractPlatform
The database platform abstraction.
$query  : Query
$queryComponents  : array<string|int, mixed>
Map of all components/classes that appear in the DQL query.
$quoteStrategy  : QuoteStrategy
The quote strategy.
$rootAliases  : mixed
The DQL alias of the root class of the currently traversed query.
$rsm  : ResultSetMapping
$scalarFields  : array<string, array<string, string>>
Map from DQL-Alias + Field-Name to SQL Column Alias.
$scalarResultAliasMap  : mixed
Map from result variable names to their SQL column alias names.
$scalarResultCounter  : int
Counter for generating unique scalar result.
$selectedClasses  : mixed
A list of classes that appear in non-scalar SelectExpressions.
$sqlParamIndex  : int
Counter for generating unique parameter indexes.
$tableAliasCounter  : int
Counter for generating unique table aliases.
$tableAliasMap  : array<string|int, mixed>
$useSqlTableAliases  : bool
Flag that indicates whether to generate SQL table aliases in the SQL.
__construct()  : mixed
Stores various parameters that are otherwise unavailable because Doctrine\ORM\Query\SqlWalker keeps everything private without accessors.
getConnection()  : Connection
Gets the Connection used by the walker.
getEntityManager()  : EntityManagerInterface
Gets the EntityManager used by the walker.
getExecutor()  : AbstractSqlExecutor
Gets an executor that can be used to execute the result of this walker.
getOrderByPathExpressions()  : array<string|int, mixed>
getter for $orderByPathExpressions
getQuery()  : Query
Gets the Query instance used by the walker.
getQueryComponent()  : array<string|int, mixed>
Gets the information about a single query component.
getQueryComponents()  : array<string, array<string, mixed>>
Returns internal queryComponents array.
getSQLColumnAlias()  : string
Gets an SQL column alias for a column name.
getSQLTableAlias()  : string
Generates a unique, short SQL table alias.
setQueryComponent()  : void
Sets or overrides a query component for a given dql alias.
setSQLTableAlias()  : string
Forces the SqlWalker to use a specific alias for a table name, rather than generating an alias on its own.
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.
walkArithmeticPrimary()  : string
Walks down an ArithmeticPrimary 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.
walkCoalesceExpression()  : string
Walks down a CoalesceExpression AST node and generates the corresponding 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.
walkEntityIdentificationVariable()  : string
Walks down an IdentificationVariable 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.
walkGeneralCaseExpression()  : string
Walks down a GeneralCaseExpression AST node and generates the corresponding 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.
walkIdentificationVariable()  : string
Walks down an IdentificationVariable (no AST node associated), thereby generating the SQL.
walkIdentificationVariableDeclaration()  : string
Walks down a IdentificationVariableDeclaration AST node, thereby generating the appropriate SQL.
walkIndexBy()  : void
Walks down a IndexBy AST node.
walkInExpression()  : string
Walks down an InExpression AST node, thereby generating the appropriate SQL.
walkInParameter()  : string
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.
walkJoinAssociationDeclaration()  : string
Walks down a JoinAssociationDeclaration AST node, thereby generating the appropriate 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.
walkNewObject()  : string
walkNullComparisonExpression()  : string
Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.
walkNullIfExpression()  : string
Walks down a NullIfExpression AST node and generates the corresponding 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.
walkParenthesisExpression()  : string
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.
walkRangeVariableDeclaration()  : string
Walks down a RangeVariableDeclaration 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, wrapping it in a SELECT DISTINCT.
walkSelectStatementWithoutRowNumber()  : string
Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.
walkSelectStatementWithRowNumber()  : string
Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.
walkSimpleArithmeticExpression()  : string
Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.
walkSimpleCaseExpression()  : string
Walks down a SimpleCaseExpression AST node and generates the corresponding 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.
walkSubSelect()  : mixed
{@inheritdoc}
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.
addMissingItemsFromOrderByToSelect()  : void
Finds all PathExpressions in an AST's OrderByClause, and ensures that the referenced fields are present in the SelectClause of the passed AST.
generateClassTableInheritanceJoins()  : string
Generates the SQL JOINs that are necessary for Class Table Inheritance for the given class.
generateDiscriminatorColumnConditionSQL()  : string
Generates a discriminator column SQL condition for the class with the given DQL alias.
generateFilterConditionSQL()  : string
Generates the filter SQL for a given entity and table alias.
generateOrderedCollectionOrderByItems()  : string
generateRangeVariableDeclarationSQL()  : string
Generate appropriate SQL for RangeVariableDeclaration AST node
generateSqlAliasReplacements()  : array<string|int, array<string|int, string>>
getChildDiscriminatorsFromClassMetadata()  : string
getInnerSQL()  : string
getSQLIdentifier()  : array<string|int, string>
platformSupportsRowNumber()  : bool
Check if the platform supports the ROW_NUMBER window function.
preserveSqlOrdering()  : string
Generates new SQL for statements with an order by clause
rebuildOrderByForRowNumber()  : void
Rebuilds a select statement's order by clause for use in a ROW_NUMBER() OVER() expression.
recreateInnerSql()  : string
Generates a new SQL statement for the inner query to keep the correct sorting

Constants

HINT_DISTINCT

public mixed HINT_DISTINCT = 'doctrine.distinct'

HINT_PARTIAL

Used to mark a query as containing a PARTIAL expression, which needs to be known by SLC.

public mixed HINT_PARTIAL = 'doctrine.partial'

Properties

$aliasCounter

Counter for generating unique column aliases.

private int $aliasCounter = 0

$inSubSelect

private bool $inSubSelect = false

We don't want to add path expressions from sub-selects into the select clause of the containing query. This state flag simply keeps track on whether we are walking on a subquery or not

$newObjectCounter

Counter for generating indexes.

private int $newObjectCounter = 0

$orderedColumnsMap

Map from Table-Alias + Column-Name to OrderBy-Direction.

private array<string, string> $orderedColumnsMap = []

$queryComponents

Map of all components/classes that appear in the DQL query.

private array<string|int, mixed> $queryComponents

$rootAliases

The DQL alias of the root class of the currently traversed query.

private mixed $rootAliases = []
Tags
psalm-var

list

$scalarFields

Map from DQL-Alias + Field-Name to SQL Column Alias.

private array<string, array<string, string>> $scalarFields = []

$scalarResultAliasMap

Map from result variable names to their SQL column alias names.

private mixed $scalarResultAliasMap = []
Tags
psalm-var

array<string, string|list>

$scalarResultCounter

Counter for generating unique scalar result.

private int $scalarResultCounter = 1

$selectedClasses

A list of classes that appear in non-scalar SelectExpressions.

private mixed $selectedClasses = []
Tags
psalm-var

list<array{class: ClassMetadata, dqlAlias: string, resultAlias: string}>

$sqlParamIndex

Counter for generating unique parameter indexes.

private int $sqlParamIndex = 0

$tableAliasCounter

Counter for generating unique table aliases.

private int $tableAliasCounter = 0

$tableAliasMap

private array<string|int, mixed> $tableAliasMap = []

$useSqlTableAliases

Flag that indicates whether to generate SQL table aliases in the SQL.

private bool $useSqlTableAliases = true

These should only be generated for SELECT queries, not for UPDATE/DELETE.

Methods

__construct()

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

public __construct(Query $query, ParserResult $parserResult, array<string|int, mixed> $queryComponents) : mixed
Parameters
$query : Query
$parserResult : ParserResult
$queryComponents : array<string|int, mixed>
Return values
mixed

getConnection()

Gets the Connection used by the walker.

public getConnection() : Connection
Return values
Connection

getOrderByPathExpressions()

getter for $orderByPathExpressions

public getOrderByPathExpressions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getQuery()

Gets the Query instance used by the walker.

public getQuery() : Query
Return values
Query

getQueryComponent()

Gets the information about a single query component.

public getQueryComponent(string $dqlAlias) : array<string|int, mixed>
Parameters
$dqlAlias : string

The DQL alias.

Tags
psalm-return

array{ metadata: ClassMetadata, parent: string, relation: mixed[], map: mixed, nestingLevel: int, token: array }

Return values
array<string|int, mixed>

getQueryComponents()

Returns internal queryComponents array.

public getQueryComponents() : array<string, array<string, mixed>>
Return values
array<string, array<string, mixed>>

getSQLColumnAlias()

Gets an SQL column alias for a column name.

public getSQLColumnAlias(string $columnName) : string
Parameters
$columnName : string
Return values
string

getSQLTableAlias()

Generates a unique, short SQL table alias.

public getSQLTableAlias(string $tableName[, string $dqlAlias = '' ]) : string
Parameters
$tableName : string

Table name

$dqlAlias : string = ''

The DQL alias.

Return values
string

Generated table alias.

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

setSQLTableAlias()

Forces the SqlWalker to use a specific alias for a table name, rather than generating an alias on its own.

public setSQLTableAlias(string $tableName, string $alias[, string $dqlAlias = '' ]) : string
Parameters
$tableName : string
$alias : string
$dqlAlias : string = ''
Return values
string

walkAggregateExpression()

Walks down an AggregateExpression AST node, thereby generating the appropriate SQL.

public walkAggregateExpression(mixed $aggExpression) : string
Parameters
$aggExpression : mixed
Return values
string

The SQL.

walkArithmeticExpression()

Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL.

public walkArithmeticExpression(mixed $arithmeticExpr) : string
Parameters
$arithmeticExpr : mixed
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.

walkArithmeticPrimary()

Walks down an ArithmeticPrimary that represents an AST node, thereby generating the appropriate SQL.

public walkArithmeticPrimary(mixed $primary) : string
Parameters
$primary : 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(mixed $betweenExpr) : string
Parameters
$betweenExpr : mixed
Return values
string

The SQL.

walkCoalesceExpression()

Walks down a CoalesceExpression AST node and generates the corresponding SQL.

public walkCoalesceExpression(CoalesceExpression $coalesceExpression) : string
Parameters
$coalesceExpression : CoalesceExpression
Return values
string

The SQL.

walkCollectionMemberExpression()

Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL.

public walkCollectionMemberExpression(mixed $collMemberExpr) : string
Parameters
$collMemberExpr : mixed
Return values
string

The SQL.

walkComparisonExpression()

Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL.

public walkComparisonExpression(mixed $compExpr) : string
Parameters
$compExpr : mixed
Return values
string

The SQL.

walkConditionalExpression()

Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL.

public walkConditionalExpression(mixed $condExpr) : string
Parameters
$condExpr : mixed
Return values
string

The SQL.

walkConditionalFactor()

Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL.

public walkConditionalFactor(mixed $factor) : string
Parameters
$factor : mixed
Return values
string

The SQL.

walkConditionalPrimary()

Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL.

public walkConditionalPrimary(mixed $primary) : string
Parameters
$primary : mixed
Return values
string

The SQL.

walkConditionalTerm()

Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL.

public walkConditionalTerm(mixed $condTerm) : string
Parameters
$condTerm : mixed
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(mixed $emptyCollCompExpr) : string
Parameters
$emptyCollCompExpr : mixed
Return values
string

The SQL.

walkEntityIdentificationVariable()

Walks down an IdentificationVariable AST node, thereby generating the appropriate SQL.

public walkEntityIdentificationVariable(string $identVariable) : string

This one differs of ->walkIdentificationVariable() because it generates the entity identifiers.

Parameters
$identVariable : string
Return values
string

walkExistsExpression()

Walks down an ExistsExpression AST node, thereby generating the appropriate SQL.

public walkExistsExpression(mixed $existsExpr) : string
Parameters
$existsExpr : mixed
Return values
string

The SQL.

walkFromClause()

Walks down a FromClause AST node, thereby generating the appropriate SQL.

public walkFromClause(mixed $fromClause) : string
Parameters
$fromClause : mixed
Return values
string

The SQL.

walkFunction()

Walks down a FunctionNode AST node, thereby generating the appropriate SQL.

public walkFunction(mixed $function) : string
Parameters
$function : mixed
Return values
string

The SQL.

walkGeneralCaseExpression()

Walks down a GeneralCaseExpression AST node and generates the corresponding SQL.

public walkGeneralCaseExpression(GeneralCaseExpression $generalCaseExpression) : string
Parameters
$generalCaseExpression : GeneralCaseExpression
Return values
string

The SQL.

walkGroupByClause()

Walks down a GroupByClause AST node, thereby generating the appropriate SQL.

public walkGroupByClause(mixed $groupByClause) : string
Parameters
$groupByClause : mixed
Return values
string

The SQL.

walkGroupByItem()

Walks down a GroupByItem AST node, thereby generating the appropriate SQL.

public walkGroupByItem(mixed $groupByItem) : string
Parameters
$groupByItem : mixed
Return values
string

The SQL.

walkHavingClause()

Walks down a HavingClause AST node, thereby generating the appropriate SQL.

public walkHavingClause(mixed $havingClause) : string
Parameters
$havingClause : mixed
Return values
string

The SQL.

walkIdentificationVariable()

Walks down an IdentificationVariable (no AST node associated), thereby generating the SQL.

public walkIdentificationVariable(string $identificationVariable[, string $fieldName = null ]) : string
Parameters
$identificationVariable : string
$fieldName : string = null
Return values
string

The SQL.

walkIndexBy()

Walks down a IndexBy AST node.

public walkIndexBy(IndexBy $indexBy) : void
Parameters
$indexBy : IndexBy
Return values
void

walkInExpression()

Walks down an InExpression AST node, thereby generating the appropriate SQL.

public walkInExpression(mixed $inExpr) : string
Parameters
$inExpr : mixed
Return values
string

The SQL.

walkInParameter()

public walkInParameter(mixed $inParam) : string
Parameters
$inParam : mixed
Return values
string

walkInputParameter()

Walks down an InputParameter AST node, thereby generating the appropriate SQL.

public walkInputParameter(mixed $inputParam) : string
Parameters
$inputParam : mixed
Return values
string

The SQL.

walkInstanceOfExpression()

Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL.

public walkInstanceOfExpression(mixed $instanceOfExpr) : string
Parameters
$instanceOfExpr : mixed
Tags
throws
QueryException
Return values
string

The SQL.

walkJoin()

Walks down a Join AST node and creates the corresponding SQL.

public walkJoin(mixed $join) : string
Parameters
$join : mixed
Return values
string

The SQL.

walkJoinAssociationDeclaration()

Walks down a JoinAssociationDeclaration AST node, thereby generating the appropriate SQL.

public walkJoinAssociationDeclaration(JoinAssociationDeclaration $joinAssociationDeclaration[, int $joinType = ASTJoin::JOIN_TYPE_INNER ][, ConditionalExpression $condExpr = null ]) : string
Parameters
$joinAssociationDeclaration : JoinAssociationDeclaration
$joinType : int = ASTJoin::JOIN_TYPE_INNER
$condExpr : ConditionalExpression = null
Tags
throws
QueryException
Return values
string

walkLikeExpression()

Walks down a LikeExpression AST node, thereby generating the appropriate SQL.

public walkLikeExpression(mixed $likeExpr) : string
Parameters
$likeExpr : mixed
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.

walkNewObject()

public walkNewObject(NewObjectExpression $newObjectExpression[, string|null $newObjectResultAlias = null ]) : string
Parameters
$newObjectExpression : NewObjectExpression
$newObjectResultAlias : string|null = null
Return values
string

The SQL.

walkNullComparisonExpression()

Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL.

public walkNullComparisonExpression(mixed $nullCompExpr) : string
Parameters
$nullCompExpr : mixed
Return values
string

The SQL.

walkNullIfExpression()

Walks down a NullIfExpression AST node and generates the corresponding SQL.

public walkNullIfExpression(NullIfExpression $nullIfExpression) : string
Parameters
$nullIfExpression : NullIfExpression
Return values
string

The SQL.

walkOrderByClause()

Walks down an OrderByClause AST node, thereby generating the appropriate SQL.

public walkOrderByClause(mixed $orderByClause) : string
Parameters
$orderByClause : mixed
Return values
string

The SQL.

walkOrderByItem()

Walks down an OrderByItem AST node, thereby generating the appropriate SQL.

public walkOrderByItem(mixed $orderByItem) : string
Parameters
$orderByItem : mixed
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(mixed $qExpr) : string
Parameters
$qExpr : mixed
Return values
string

The SQL.

walkRangeVariableDeclaration()

Walks down a RangeVariableDeclaration AST node, thereby generating the appropriate SQL.

public walkRangeVariableDeclaration(RangeVariableDeclaration $rangeVariableDeclaration) : string
Parameters
$rangeVariableDeclaration : RangeVariableDeclaration
Return values
string

walkResultVariable()

Walks down a ResultVariable that represents an AST node, thereby generating the appropriate SQL.

public walkResultVariable(mixed $resultVariable) : string
Parameters
$resultVariable : mixed
Return values
string

The SQL.

walkSelectClause()

Walks down a SelectClause AST node, thereby generating the appropriate SQL.

public walkSelectClause(mixed $selectClause) : string
Parameters
$selectClause : mixed
Return values
string

The SQL.

walkSelectExpression()

Walks down a SelectExpression AST node and generates the corresponding SQL.

public walkSelectExpression(mixed $selectExpression) : string
Parameters
$selectExpression : mixed
Return values
string

The SQL.

walkSelectStatementWithoutRowNumber()

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

public walkSelectStatementWithoutRowNumber(SelectStatement $AST[, bool $addMissingItemsFromOrderByToSelect = true ]) : string

This method is for platforms which DO NOT support ROW_NUMBER.

Parameters
$AST : SelectStatement
$addMissingItemsFromOrderByToSelect : bool = true
Tags
throws
RuntimeException
Return values
string

walkSelectStatementWithRowNumber()

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

public walkSelectStatementWithRowNumber(SelectStatement $AST) : string

This method is for use with platforms which support ROW_NUMBER.

Parameters
$AST : SelectStatement
Tags
throws
RuntimeException
Return values
string

walkSimpleArithmeticExpression()

Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL.

public walkSimpleArithmeticExpression(mixed $simpleArithmeticExpr) : string
Parameters
$simpleArithmeticExpr : mixed
Return values
string

The SQL.

walkSimpleCaseExpression()

Walks down a SimpleCaseExpression AST node and generates the corresponding SQL.

public walkSimpleCaseExpression(SimpleCaseExpression $simpleCaseExpression) : string
Parameters
$simpleCaseExpression : SimpleCaseExpression
Return values
string

The SQL.

walkSimpleSelectClause()

Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL.

public walkSimpleSelectClause(mixed $simpleSelectClause) : string
Parameters
$simpleSelectClause : mixed
Return values
string

The SQL.

walkSimpleSelectExpression()

Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL.

public walkSimpleSelectExpression(mixed $simpleSelectExpression) : string
Parameters
$simpleSelectExpression : mixed
Return values
string

The SQL.

walkStateFieldPathExpression()

Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL.

public walkStateFieldPathExpression(mixed $stateFieldPathExpression) : string
Parameters
$stateFieldPathExpression : mixed
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(mixed $subselect) : string
Parameters
$subselect : mixed
Return values
string

The SQL.

walkSubSelect()

{@inheritdoc}

public walkSubSelect(mixed $subselect) : mixed
Parameters
$subselect : mixed
Return values
mixed

walkSubselectFromClause()

Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL.

public walkSubselectFromClause(mixed $subselectFromClause) : string
Parameters
$subselectFromClause : mixed
Return values
string

The SQL.

walkUpdateClause()

Walks down an UpdateClause AST node, thereby generating the appropriate SQL.

public walkUpdateClause(mixed $updateClause) : string
Parameters
$updateClause : mixed
Return values
string

The SQL.

walkUpdateItem()

Walks down an UpdateItem AST node, thereby generating the appropriate SQL.

public walkUpdateItem(mixed $updateItem) : string
Parameters
$updateItem : mixed
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(mixed $whereClause) : string
Parameters
$whereClause : mixed
Return values
string

The SQL.

addMissingItemsFromOrderByToSelect()

Finds all PathExpressions in an AST's OrderByClause, and ensures that the referenced fields are present in the SelectClause of the passed AST.

private addMissingItemsFromOrderByToSelect(SelectStatement $AST) : void
Parameters
$AST : SelectStatement
Return values
void

generateClassTableInheritanceJoins()

Generates the SQL JOINs that are necessary for Class Table Inheritance for the given class.

private generateClassTableInheritanceJoins(ClassMetadata $class, string $dqlAlias) : string
Parameters
$class : ClassMetadata

The class for which to generate the joins.

$dqlAlias : string

The DQL alias of the class.

Return values
string

The SQL.

generateDiscriminatorColumnConditionSQL()

Generates a discriminator column SQL condition for the class with the given DQL alias.

private generateDiscriminatorColumnConditionSQL(array<string|int, mixed> $dqlAliases) : string
Parameters
$dqlAliases : array<string|int, mixed>
Tags
psalm-param

list $dqlAliases List of root DQL aliases to inspect for discriminator restrictions.

Return values
string

generateFilterConditionSQL()

Generates the filter SQL for a given entity and table alias.

private generateFilterConditionSQL(ClassMetadata $targetEntity, string $targetTableAlias) : string
Parameters
$targetEntity : ClassMetadata

Metadata of the target entity.

$targetTableAlias : string

The table alias of the joined/selected table.

Return values
string

The SQL query part to add to a query.

generateOrderedCollectionOrderByItems()

private generateOrderedCollectionOrderByItems() : string
Return values
string

generateRangeVariableDeclarationSQL()

Generate appropriate SQL for RangeVariableDeclaration AST node

private generateRangeVariableDeclarationSQL(RangeVariableDeclaration $rangeVariableDeclaration, bool $buildNestedJoins) : string
Parameters
$rangeVariableDeclaration : RangeVariableDeclaration
$buildNestedJoins : bool
Return values
string

generateSqlAliasReplacements()

private generateSqlAliasReplacements() : array<string|int, array<string|int, string>>
Tags
psalm-return

array{0: list, 1: list}

Return values
array<string|int, array<string|int, string>>

platformSupportsRowNumber()

Check if the platform supports the ROW_NUMBER window function.

private platformSupportsRowNumber() : bool
Return values
bool

preserveSqlOrdering()

Generates new SQL for statements with an order by clause

private preserveSqlOrdering(array<string|int, mixed> $sqlIdentifier, string $innerSql, string $sql, OrderByClause|null $orderByClause) : string
Parameters
$sqlIdentifier : array<string|int, mixed>
$innerSql : string
$sql : string
$orderByClause : OrderByClause|null
Return values
string

recreateInnerSql()

Generates a new SQL statement for the inner query to keep the correct sorting

private recreateInnerSql(OrderByClause $orderByClause, array<string|int, mixed> $identifiers, string $innerSql) : string
Parameters
$orderByClause : OrderByClause
$identifiers : array<string|int, mixed>
$innerSql : string
Return values
string

Search results