Doctrine


Doctrine\ORM\Query\SqlWalker
/Doctrine/ORM/Query/SqlWalker.php at line 36

Class SqlWalker

SqlWalker

public class SqlWalker

The SqlWalker is a TreeWalker that walks over a DQL AST and constructs the corresponding SQL.

Author:
Roman Borschel
Benjamin Eberlei
Since:
2.0
Todo:
Rename: SQLWalker

Constructor Summary

SqlWalker(mixed query, mixed parserResult, mixed queryComponents)

{@inheritDoc}

Method Summary
Connection

getConnection()

Gets the Connection used by the walker.

EntityManager

getEntityManager()

Gets the EntityManager used by the walker.

AbstractExecutor

getExecutor(mixed AST)

Gets an executor that can be used to execute the result of this walker.

Query.

getQuery()

Gets the Query instance used by the walker.

array

getQueryComponent(string dqlAlias)

Gets the information about a single query component.

string

getSqlColumnAlias(string columnName)

Gets an SQL column alias for a column name.

string

getSqlTableAlias(mixed tableName, string dqlAlias)

Generates a unique, short SQL table alias.

void

setSqlTableAlias(string tableName, string alias)

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

string

walkAggregateExpression(mixed aggExpression, AggregateExpression )

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

string

walkArithmeticExpression(mixed arithmeticExpr, ArithmeticExpression )

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

string

walkArithmeticFactor(mixed factor, mixed )

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

string

walkArithmeticTerm(mixed term, mixed )

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

string

walkBetweenExpression(mixed betweenExpr, BetweenExpression )

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

string

walkCollectionMemberExpression(mixed collMemberExpr, CollectionMemberExpression )

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

string

walkComparisonExpression(mixed compExpr, ComparisonExpression )

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

string

walkConditionalFactor(mixed factor, ConditionalFactor )

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

string

walkConditionalTerm(mixed condTerm, ConditionalTerm )

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

string

walkDeleteClause(mixed deleteClause, DeleteClause )

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

string

walkDeleteStatement(mixed AST, DeleteStatement )

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

string

walkEmptyCollectionComparisonExpression(mixed emptyCollCompExpr, EmptyCollectionComparisonExpression )

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

string

walkExistsExpression(mixed existsExpr, ExistsExpression )

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

string

walkFromClause(mixed fromClause)

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

string

walkFunction(mixed function)

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

string

walkGroupByClause(mixed groupByClause, GroupByClause )

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

string

walkGroupByItem(mixed pathExpr, GroupByItem )

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

string

walkHavingClause(mixed havingClause, HavingClause )

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

string

walkIdentificationVariable(string identificationVariable, mixed fieldName)

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

string

walkInExpression(mixed inExpr, InExpression )

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

void

walkInParameter(mixed inParam)

string

walkInputParameter(mixed inputParam, InputParameter )

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

string

walkJoinVariableDeclaration(JoinVariableDeclaration joinVarDecl)

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

string

walkLikeExpression(mixed likeExpr, LikeExpression )

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

string

walkLiteral(mixed literal, mixed )

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

string

walkNullComparisonExpression(mixed nullCompExpr, NullComparisonExpression )

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

string

walkOrderByClause(mixed orderByClause, OrderByClause )

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

string

walkOrderByItem(mixed orderByItem, OrderByItem )

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

string

walkPathExpression(mixed pathExpr, mixed )

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

string

walkQuantifiedExpression(mixed qExpr, QuantifiedExpression )

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

string

walkSelectClause(mixed selectClause, $selectClause )

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

string

walkSelectExpression(SelectExpression selectExpression)

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

string

walkSelectStatement(mixed AST)

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

string

walkSimpleArithmeticExpression(mixed simpleArithmeticExpr, SimpleArithmeticExpression )

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

string

walkSimpleSelectClause(mixed simpleSelectClause, SimpleSelectClause )

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

string

walkSimpleSelectExpression(mixed simpleSelectExpression, SimpleSelectExpression )

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

string

walkStateFieldPathExpression(mixed stateFieldPathExpression, StateFieldPathExpression )

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

string

walkStringPrimary(mixed stringPrimary, mixed )

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

string

walkSubselect(mixed subselect, Subselect )

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

string

walkSubselectFromClause(mixed subselectFromClause, SubselectFromClause )

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

string

walkUpdateClause(mixed updateClause, UpdateClause )

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

string

walkUpdateItem(mixed updateItem, UpdateItem )

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

string

walkUpdateStatement(mixed AST, UpdateStatement )

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

string

walkWhereClause(mixed whereClause, WhereClause )

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

Constructor Detail

/Doctrine/ORM/Query/SqlWalker.php at line 102

SqlWalker

public SqlWalker(mixed query, mixed parserResult, mixed queryComponents)


Method Detail

/Doctrine/ORM/Query/SqlWalker.php at line 128

getConnection

public Connection getConnection()

Gets the Connection used by the walker.


/Doctrine/ORM/Query/SqlWalker.php at line 138

getEntityManager

public EntityManager getEntityManager()

Gets the EntityManager used by the walker.


/Doctrine/ORM/Query/SqlWalker.php at line 159

getExecutor

public AbstractExecutor getExecutor(mixed AST)

Gets an executor that can be used to execute the result of this walker.


/Doctrine/ORM/Query/SqlWalker.php at line 118

getQuery

public Query. getQuery()

Gets the Query instance used by the walker.


/Doctrine/ORM/Query/SqlWalker.php at line 149

getQueryComponent

public array getQueryComponent(string dqlAlias)

Gets the information about a single query component.

Parameters:
dqlAlias - The DQL alias.

/Doctrine/ORM/Query/SqlWalker.php at line 226

getSqlColumnAlias

public string getSqlColumnAlias(string columnName)

Gets an SQL column alias for a column name.


/Doctrine/ORM/Query/SqlWalker.php at line 195

getSqlTableAlias

public string getSqlTableAlias(mixed tableName, string dqlAlias)

Generates a unique, short SQL table alias.

Parameters:
dqlAlias - The DQL alias.
Returns:
Generated table alias.

/Doctrine/ORM/Query/SqlWalker.php at line 213

setSqlTableAlias

public void setSqlTableAlias(string tableName, string alias)

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


/Doctrine/ORM/Query/SqlWalker.php at line 1091

walkAggregateExpression

public string walkAggregateExpression(mixed aggExpression, AggregateExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1597

walkArithmeticExpression

public string walkArithmeticExpression(mixed arithmeticExpr, ArithmeticExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1638

walkArithmeticFactor

public string walkArithmeticFactor(mixed factor, mixed )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1610

walkArithmeticTerm

public string walkArithmeticTerm(mixed term, mixed )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1499

walkBetweenExpression

public string walkBetweenExpression(mixed betweenExpr, BetweenExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1288

walkCollectionMemberExpression

public string walkCollectionMemberExpression(mixed collMemberExpr, CollectionMemberExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1555

walkComparisonExpression

public string walkComparisonExpression(mixed compExpr, ComparisonExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1248

walkConditionalFactor

public string walkConditionalFactor(mixed factor, ConditionalFactor )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1235

walkConditionalTerm

public string walkConditionalTerm(mixed condTerm, ConditionalTerm )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1127

walkDeleteClause

public string walkDeleteClause(mixed deleteClause, DeleteClause )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 403

walkDeleteStatement

public string walkDeleteStatement(mixed AST, DeleteStatement )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1410

walkEmptyCollectionComparisonExpression

public string walkEmptyCollectionComparisonExpression(mixed emptyCollCompExpr, EmptyCollectionComparisonExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1273

walkExistsExpression

public string walkExistsExpression(mixed existsExpr, ExistsExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 583

walkFromClause

public string walkFromClause(mixed fromClause)

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 613

walkFunction

public string walkFunction(mixed function)

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1103

walkGroupByClause

public string walkGroupByClause(mixed groupByClause, GroupByClause )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1116

walkGroupByItem

public string walkGroupByItem(mixed pathExpr, GroupByItem )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 665

walkHavingClause

public string walkHavingClause(mixed havingClause, HavingClause )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 424

walkIdentificationVariable

public string walkIdentificationVariable(string identificationVariable, mixed fieldName)

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1448

walkInExpression

public string walkInExpression(mixed inExpr, InExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1464

walkInParameter

public void walkInParameter(mixed inParam)

/Doctrine/ORM/Query/SqlWalker.php at line 1584

walkInputParameter

public string walkInputParameter(mixed inputParam, InputParameter )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 678

walkJoinVariableDeclaration

public string walkJoinVariableDeclaration(JoinVariableDeclaration joinVarDecl)

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1517

walkLikeExpression

public string walkLikeExpression(mixed likeExpr, LikeExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1477

walkLiteral

public string walkLiteral(mixed literal, mixed )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1424

walkNullComparisonExpression

public string walkNullComparisonExpression(mixed nullCompExpr, NullComparisonExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 624

walkOrderByClause

public string walkOrderByClause(mixed orderByClause, OrderByClause )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 643

walkOrderByItem

public string walkOrderByItem(mixed orderByItem, OrderByItem )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 444

walkPathExpression

public string walkPathExpression(mixed pathExpr, mixed )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 983

walkQuantifiedExpression

public string walkQuantifiedExpression(mixed qExpr, QuantifiedExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 500

walkSelectClause

public string walkSelectClause(mixed selectClause, $selectClause )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 803

walkSelectExpression

public string walkSelectExpression(SelectExpression selectExpression)

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 349

walkSelectStatement

public string walkSelectStatement(mixed AST)

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1662

walkSimpleArithmeticExpression

public string walkSimpleArithmeticExpression(mixed simpleArithmeticExpr, SimpleArithmeticExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1046

walkSimpleSelectClause

public string walkSimpleSelectClause(mixed simpleSelectClause, SimpleSelectClause )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1058

walkSimpleSelectExpression

public string walkSimpleSelectExpression(mixed simpleSelectExpression, SimpleSelectExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1544

walkStateFieldPathExpression

public string walkStateFieldPathExpression(mixed stateFieldPathExpression, StateFieldPathExpression )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1625

walkStringPrimary

public string walkStringPrimary(mixed stringPrimary, mixed )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 995

walkSubselect

public string walkSubselect(mixed subselect, Subselect )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1018

walkSubselectFromClause

public string walkSubselectFromClause(mixed subselectFromClause, SubselectFromClause )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1148

walkUpdateClause

public string walkUpdateClause(mixed updateClause, UpdateClause )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1173

walkUpdateItem

public string walkUpdateItem(mixed updateItem, UpdateItem )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 383

walkUpdateStatement

public string walkUpdateStatement(mixed AST, UpdateStatement )

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

Returns:
The SQL.

/Doctrine/ORM/Query/SqlWalker.php at line 1211

walkWhereClause

public string walkWhereClause(mixed whereClause, WhereClause )

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

Returns:
The SQL.

Doctrine