PHP Class Doctrine\ORM\Query\Parser

Parses a DQL query, reports any errors in it, and generates an AST.
Since: 2.0
Author: Guilherme Blanco ([email protected])
Author: Jonathan Wage ([email protected])
Author: Roman Borschel ([email protected])
Author: Janne Vanhala ([email protected])
Mostrar archivo Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
AbstractSchemaName ( ) : string AbstractSchemaName ::= identifier
AggregateExpression ( ) : Doctrine\ORM\Query\AST\AggregateExpression AggregateExpression ::= ("AVG" | "MAX" | "MIN" | "SUM") "(" ["DISTINCT"] StateFieldPathExpression ")" | "COUNT" "(" ["DISTINCT"] (IdentificationVariable | SingleValuedPathExpression) ")"
AliasIdentificationVariable ( ) : string AliasIdentificationVariable = identifier
AliasResultVariable ( ) : string AliasResultVariable ::= identifier
ArithmeticExpression ( ) : Doctrine\ORM\Query\AST\ArithmeticExpression ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")"
ArithmeticFactor ( ) : Doctrine\ORM\Query\AST\ArithmeticFactor ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary
ArithmeticPrimary ( ) ArithmeticPrimary ::= SingleValuedPathExpression | Literal | "(" SimpleArithmeticExpression ")" | FunctionsReturningNumerics | AggregateExpression | FunctionsReturningStrings | FunctionsReturningDatetime | IdentificationVariable
ArithmeticTerm ( ) : Doctrine\ORM\Query\AST\ArithmeticTerm ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}*
AssociationPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression
BetweenExpression ( ) : Doctrine\ORM\Query\AST\BetweenExpression BetweenExpression ::= ArithmeticExpression ["NOT"] "BETWEEN" ArithmeticExpression "AND" ArithmeticExpression
CaseExpression ( )
CollectionMemberExpression ( ) : Doctrine\ORM\Query\AST\CollectionMemberExpression CollectionMemberExpression ::= EntityExpression ["NOT"] "MEMBER" ["OF"] CollectionValuedPathExpression
CollectionValuedPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField
ComparisonExpression ( ) : Doctrine\ORM\Query\AST\ComparisonExpression ComparisonExpression ::= ArithmeticExpression ComparisonOperator ( QuantifiedExpression | ArithmeticExpression )
ComparisonOperator ( ) : string ComparisonOperator ::= "=" | "<" | "<=" | "<>" | ">" | ">=" | "!="
ConditionalExpression ( ) : Doctrine\ORM\Query\AST\ConditionalExpression ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}*
ConditionalFactor ( ) : Doctrine\ORM\Query\AST\ConditionalFactor ConditionalFactor ::= ["NOT"] ConditionalPrimary
ConditionalPrimary ( ) : Doctrine\ORM\Query\AST\ConditionalPrimary ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")"
ConditionalTerm ( ) : Doctrine\ORM\Query\AST\ConditionalTerm ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}*
CustomFunctionsReturningDatetime ( )
CustomFunctionsReturningNumerics ( )
CustomFunctionsReturningStrings ( )
DeleteClause ( ) : Doctrine\ORM\Query\AST\DeleteClause DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName ["AS"] AliasIdentificationVariable
DeleteStatement ( ) : Doctrine\ORM\Query\AST\DeleteStatement DeleteStatement ::= DeleteClause [WhereClause]
EmptyCollectionComparisonExpression ( ) : Doctrine\ORM\Query\AST\EmptyCollectionComparisonExpression EmptyCollectionComparisonExpression ::= CollectionValuedPathExpression "IS" ["NOT"] "EMPTY"
EntityExpression ( ) : Doctrine\ORM\Query\AST\SingleValuedAssociationPathExpression EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
ExistsExpression ( ) : Doctrine\ORM\Query\AST\ExistsExpression ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")"
FromClause ( ) : Doctrine\ORM\Query\AST\FromClause FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration}*
FunctionDeclaration ( ) FunctionDeclaration ::= FunctionsReturningStrings | FunctionsReturningNumerics | FunctionsReturningDatetime
FunctionsReturningDatetime ( ) FunctionsReturningDateTime ::= "CURRENT_DATE" | "CURRENT_TIME" | "CURRENT_TIMESTAMP"
FunctionsReturningNumerics ( ) FunctionsReturningNumerics ::= "LENGTH" "(" StringPrimary ")" | "LOCATE" "(" StringPrimary "," StringPrimary ["," SimpleArithmeticExpression]")" | "ABS" "(" SimpleArithmeticExpression ")" | "SQRT" "(" SimpleArithmeticExpression ")" | "MOD" "(" SimpleArithmeticExpression "," SimpleArithmeticExpression ")" | "SIZE" "(" CollectionValuedPathExpression ")"
FunctionsReturningStrings ( ) FunctionsReturningStrings ::= "CONCAT" "(" StringPrimary "," StringPrimary ")" | "SUBSTRING" "(" StringPrimary "," SimpleArithmeticExpression "," SimpleArithmeticExpression ")" | "TRIM" "(" [["LEADING" | "TRAILING" | "BOTH"] [char] "FROM"] StringPrimary ")" | "LOWER" "(" StringPrimary ")" | "UPPER" "(" StringPrimary ")"
GroupByClause ( ) : Doctrine\ORM\Query\AST\GroupByClause GroupByClause ::= "GROUP" "BY" GroupByItem {"," GroupByItem}*
GroupByItem ( ) : string GroupByItem ::= IdentificationVariable | SingleValuedPathExpression
HavingClause ( ) : Doctrine\ORM\Query\AST\HavingClause HavingClause ::= "HAVING" ConditionalExpression
IdentificationVariable ( ) : string IdentificationVariable ::= identifier
IdentificationVariableDeclaration ( ) : Doctrine\ORM\Query\AST\IdentificationVariableDeclaration IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}*
InExpression ( ) : Doctrine\ORM\Query\AST\InExpression InExpression ::= SingleValuedPathExpression ["NOT"] "IN" "(" (InParameter {"," InParameter}* | Subselect) ")"
InParameter ( ) : string InParameter ::= Literal | InputParameter
IndexBy ( ) : Doctrine\ORM\Query\AST\IndexBy IndexBy ::= "INDEX" "BY" StateFieldPathExpression
InputParameter ( ) : Doctrine\ORM\Query\AST\InputParameter InputParameter ::= PositionalParameter | NamedParameter
InstanceOfExpression ( ) : Doctrine\ORM\Query\AST\InstanceOfExpression InstanceOfExpression ::= IdentificationVariable ["NOT"] "INSTANCE" ["OF"] (AbstractSchemaName | InputParameter)
Join ( ) : Doctrine\ORM\Query\AST\Join Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression ["AS"] AliasIdentificationVariable ["WITH" ConditionalExpression]
JoinAssociationPathExpression ( ) : Doctrine\ORM\Query\AST\JoinAssociationPathExpression JoinAssociationPathExpression ::= IdentificationVariable "." (CollectionValuedAssociationField | SingleValuedAssociationField)
JoinVariableDeclaration ( ) : Doctrine\ORM\Query\AST\JoinVariableDeclaration JoinVariableDeclaration ::= Join [IndexBy]
LikeExpression ( ) : Doctrine\ORM\Query\AST\LikeExpression LikeExpression ::= StringExpression ["NOT"] "LIKE" (string | input_parameter) ["ESCAPE" char]
Literal ( ) : string Literal ::= string | char | integer | float | boolean
NewValue ( ) NewValue ::= SimpleArithmeticExpression | StringPrimary | DatetimePrimary | BooleanPrimary | EnumPrimary | SimpleEntityExpression | "NULL"
NullComparisonExpression ( ) : Doctrine\ORM\Query\AST\NullComparisonExpression NullComparisonExpression ::= (SingleValuedPathExpression | InputParameter) "IS" ["NOT"] "NULL"
OrderByClause ( ) : Doctrine\ORM\Query\AST\OrderByClause OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}*
OrderByItem ( ) : Doctrine\ORM\Query\AST\OrderByItem OrderByItem ::= (ResultVariable | StateFieldPathExpression) ["ASC" | "DESC"]
PartialObjectExpression ( ) : array PartialObjectExpression ::= "PARTIAL" IdentificationVariable "." PartialFieldSet PartialFieldSet ::= "{" SimpleStateField {"," SimpleStateField}* "}"
PathExpression ( integer $expectedTypes ) : Doctrine\ORM\Query\AST\PathExpression Parses an arbitrary path expression and defers semantical validation based on expected types.
QuantifiedExpression ( ) : Doctrine\ORM\Query\AST\QuantifiedExpression QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")"
QueryLanguage ( ) : Doctrine\ORM\Query\AST\SelectStatement QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement
RangeVariableDeclaration ( ) : Doctrine\ORM\Query\AST\RangeVariableDeclaration RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
ResultVariable ( ) : string ResultVariable ::= identifier
ScalarExpression ( ) : mixed ScalarExpression ::= SimpleArithmeticExpression | StringPrimary | DateTimePrimary | StateFieldPathExpression | BooleanPrimary | CaseExpression | EntityTypeExpression
SelectClause ( ) : Doctrine\ORM\Query\AST\SelectClause SelectClause ::= "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression}
SelectExpression ( ) : Doctrine\ORM\Query\AST\SelectExpression SelectExpression ::= IdentificationVariable | StateFieldPathExpression | (AggregateExpression | "(" Subselect ")" | ScalarExpression) [["AS"] AliasResultVariable]
SelectStatement ( ) : Doctrine\ORM\Query\AST\SelectStatement SelectStatement ::= SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
SimpleArithmeticExpression ( ) : Doctrine\ORM\Query\AST\SimpleArithmeticExpression SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
SimpleConditionalExpression ( ) SimpleConditionalExpression ::= ComparisonExpression | BetweenExpression | LikeExpression | InExpression | NullComparisonExpression | ExistsExpression | EmptyCollectionComparisonExpression | CollectionMemberExpression | InstanceOfExpression
SimpleEntityExpression ( ) : string SimpleEntityExpression ::= IdentificationVariable | InputParameter
SimpleSelectClause ( ) : Doctrine\ORM\Query\AST\SimpleSelectClause SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression
SimpleSelectExpression ( ) : Doctrine\ORM\Query\AST\SimpleSelectExpression SimpleSelectExpression ::= StateFieldPathExpression | IdentificationVariable | ((AggregateExpression | "(" Subselect ")" | ScalarExpression) [["AS"] AliasResultVariable])
SingleValuedAssociationPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField
SingleValuedPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
StateFieldPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression StateFieldPathExpression ::= IdentificationVariable "." StateField
StringExpression ( ) : Doctrine\ORM\Query\AST\StringPrimary StringExpression ::= StringPrimary | "(" Subselect ")"
StringPrimary ( ) StringPrimary ::= StateFieldPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression
Subselect ( ) : Doctrine\ORM\Query\AST\Subselect Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
SubselectFromClause ( ) : Doctrine\ORM\Query\AST\SubselectFromClause SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}*
SubselectIdentificationVariableDeclaration ( ) : Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration SubselectIdentificationVariableDeclaration ::= IdentificationVariableDeclaration | (AssociationPathExpression ["AS"] AliasIdentificationVariable)
UpdateClause ( ) : Doctrine\ORM\Query\AST\UpdateClause UpdateClause ::= "UPDATE" AbstractSchemaName ["AS"] AliasIdentificationVariable "SET" UpdateItem {"," UpdateItem}*
UpdateItem ( ) : Doctrine\ORM\Query\AST\UpdateItem UpdateItem ::= SingleValuedPathExpression "=" NewValue
UpdateStatement ( ) : Doctrine\ORM\Query\AST\UpdateStatement UpdateStatement ::= UpdateClause [WhereClause]
WhereClause ( ) : Doctrine\ORM\Query\AST\WhereClause WhereClause ::= "WHERE" ConditionalExpression
__construct ( Doctrine\ORM\Query $query ) Creates a new query parser object.
addCustomTreeWalker ( string $className ) Adds a custom tree walker for modifying the AST.
free ( boolean $deep = false, integer $position ) Free this parser enabling it to be reused
getAST ( ) : Doctrine\ORM\Query\AST\SelectStatement Parse and build AST for the given Query.
getEntityManager ( ) : EntityManager Gets the EntityManager used by the parser.
getLexer ( ) : Doctrine\ORM\Query\Lexer Gets the lexer used by the parser.
getParserResult ( ) : Doctrine\ORM\Query\ParserResult Gets the ParserResult that is being filled with information during parsing.
match ( $token ) : void Attempts to match the given token with the current lookahead token.
parse ( ) : Doctrine\ORM\Query\ParserResult Parses a query string.
semanticalError ( string $message = '', array $token = null ) Generates a new semantical error.
setCustomOutputTreeWalker ( string $className ) Sets a custom tree walker that produces output.
syntaxError ( string $expected = '', array $token = null ) Generates a new syntax error.

Private Methods

Method Description
_isAggregateFunction ( $tokenType ) : boolean Checks whether the given token type indicates an aggregate function.
_isFunction ( ) : boolean Checks if the next-next (after lookahead) token starts a function.
_isMathOperator ( $token ) : boolean Checks if the given token indicates a mathematical operator.
_isNextAllAnySome ( ) : boolean Checks whether the current lookahead token of the lexer has the type T_ALL, T_ANY or T_SOME.
_isSubselect ( ) : boolean Checks whether the next 2 tokens start a subselect.
_peekBeyond ( array $token ) : array Peeks beyond the specified token and returns the first token after that one.
_peekBeyondClosingParenthesis ( ) : array Peek beyond the matched closing parenthesis and return the first token after that one.
_processDeferredIdentificationVariables ( ) : void Validates that the given IdentificationVariable is semantically correct.
_processDeferredPartialObjectExpressions ( ) : void Validates that the given PartialObjectExpression is semantically correct.
_processDeferredPathExpressions ( mixed $AST ) Validates that the given PathExpression is semantically correct for grammar rules:
_processDeferredResultVariables ( ) : void Validates that the given ResultVariable is semantically correct.

Method Details

AbstractSchemaName() public method

AbstractSchemaName ::= identifier
public AbstractSchemaName ( ) : string
return string

AggregateExpression() public method

AggregateExpression ::= ("AVG" | "MAX" | "MIN" | "SUM") "(" ["DISTINCT"] StateFieldPathExpression ")" | "COUNT" "(" ["DISTINCT"] (IdentificationVariable | SingleValuedPathExpression) ")"
public AggregateExpression ( ) : Doctrine\ORM\Query\AST\AggregateExpression
return Doctrine\ORM\Query\AST\AggregateExpression

AliasIdentificationVariable() public method

AliasIdentificationVariable = identifier

AliasResultVariable() public method

AliasResultVariable ::= identifier
public AliasResultVariable ( ) : string
return string

ArithmeticExpression() public method

ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")"
public ArithmeticExpression ( ) : Doctrine\ORM\Query\AST\ArithmeticExpression
return Doctrine\ORM\Query\AST\ArithmeticExpression

ArithmeticFactor() public method

ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary
public ArithmeticFactor ( ) : Doctrine\ORM\Query\AST\ArithmeticFactor
return Doctrine\ORM\Query\AST\ArithmeticFactor

ArithmeticPrimary() public method

ArithmeticPrimary ::= SingleValuedPathExpression | Literal | "(" SimpleArithmeticExpression ")" | FunctionsReturningNumerics | AggregateExpression | FunctionsReturningStrings | FunctionsReturningDatetime | IdentificationVariable
public ArithmeticPrimary ( )

ArithmeticTerm() public method

ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}*
public ArithmeticTerm ( ) : Doctrine\ORM\Query\AST\ArithmeticTerm
return Doctrine\ORM\Query\AST\ArithmeticTerm

AssociationPathExpression() public method

AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression
public AssociationPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression
return Doctrine\ORM\Query\AST\PathExpression

BetweenExpression() public method

BetweenExpression ::= ArithmeticExpression ["NOT"] "BETWEEN" ArithmeticExpression "AND" ArithmeticExpression
public BetweenExpression ( ) : Doctrine\ORM\Query\AST\BetweenExpression
return Doctrine\ORM\Query\AST\BetweenExpression

CaseExpression() public method

public CaseExpression ( )

CollectionMemberExpression() public method

EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression SimpleEntityExpression ::= IdentificationVariable | InputParameter
public CollectionMemberExpression ( ) : Doctrine\ORM\Query\AST\CollectionMemberExpression
return Doctrine\ORM\Query\AST\CollectionMemberExpression

CollectionValuedPathExpression() public method

CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField
public CollectionValuedPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression
return Doctrine\ORM\Query\AST\PathExpression

ComparisonExpression() public method

ComparisonExpression ::= ArithmeticExpression ComparisonOperator ( QuantifiedExpression | ArithmeticExpression )
public ComparisonExpression ( ) : Doctrine\ORM\Query\AST\ComparisonExpression
return Doctrine\ORM\Query\AST\ComparisonExpression

ComparisonOperator() public method

ComparisonOperator ::= "=" | "<" | "<=" | "<>" | ">" | ">=" | "!="
public ComparisonOperator ( ) : string
return string

ConditionalExpression() public method

ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}*
public ConditionalExpression ( ) : Doctrine\ORM\Query\AST\ConditionalExpression
return Doctrine\ORM\Query\AST\ConditionalExpression

ConditionalFactor() public method

ConditionalFactor ::= ["NOT"] ConditionalPrimary
public ConditionalFactor ( ) : Doctrine\ORM\Query\AST\ConditionalFactor
return Doctrine\ORM\Query\AST\ConditionalFactor

ConditionalPrimary() public method

ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")"
public ConditionalPrimary ( ) : Doctrine\ORM\Query\AST\ConditionalPrimary
return Doctrine\ORM\Query\AST\ConditionalPrimary

ConditionalTerm() public method

ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}*
public ConditionalTerm ( ) : Doctrine\ORM\Query\AST\ConditionalTerm
return Doctrine\ORM\Query\AST\ConditionalTerm

CustomFunctionsReturningDatetime() public method

CustomFunctionsReturningNumerics() public method

CustomFunctionsReturningStrings() public method

DeleteClause() public method

DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName ["AS"] AliasIdentificationVariable
public DeleteClause ( ) : Doctrine\ORM\Query\AST\DeleteClause
return Doctrine\ORM\Query\AST\DeleteClause

DeleteStatement() public method

DeleteStatement ::= DeleteClause [WhereClause]
public DeleteStatement ( ) : Doctrine\ORM\Query\AST\DeleteStatement
return Doctrine\ORM\Query\AST\DeleteStatement

EmptyCollectionComparisonExpression() public method

EmptyCollectionComparisonExpression ::= CollectionValuedPathExpression "IS" ["NOT"] "EMPTY"
public EmptyCollectionComparisonExpression ( ) : Doctrine\ORM\Query\AST\EmptyCollectionComparisonExpression
return Doctrine\ORM\Query\AST\EmptyCollectionComparisonExpression

EntityExpression() public method

EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
public EntityExpression ( ) : Doctrine\ORM\Query\AST\SingleValuedAssociationPathExpression
return Doctrine\ORM\Query\AST\SingleValuedAssociationPathExpression | \Doctrine\ORM\Query\AST\SimpleEntityExpression

ExistsExpression() public method

ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")"
public ExistsExpression ( ) : Doctrine\ORM\Query\AST\ExistsExpression
return Doctrine\ORM\Query\AST\ExistsExpression

FromClause() public method

FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration}*
public FromClause ( ) : Doctrine\ORM\Query\AST\FromClause
return Doctrine\ORM\Query\AST\FromClause

FunctionDeclaration() public method

FunctionDeclaration ::= FunctionsReturningStrings | FunctionsReturningNumerics | FunctionsReturningDatetime
public FunctionDeclaration ( )

FunctionsReturningDatetime() public method

FunctionsReturningDateTime ::= "CURRENT_DATE" | "CURRENT_TIME" | "CURRENT_TIMESTAMP"

FunctionsReturningNumerics() public method

FunctionsReturningNumerics ::= "LENGTH" "(" StringPrimary ")" | "LOCATE" "(" StringPrimary "," StringPrimary ["," SimpleArithmeticExpression]")" | "ABS" "(" SimpleArithmeticExpression ")" | "SQRT" "(" SimpleArithmeticExpression ")" | "MOD" "(" SimpleArithmeticExpression "," SimpleArithmeticExpression ")" | "SIZE" "(" CollectionValuedPathExpression ")"

FunctionsReturningStrings() public method

FunctionsReturningStrings ::= "CONCAT" "(" StringPrimary "," StringPrimary ")" | "SUBSTRING" "(" StringPrimary "," SimpleArithmeticExpression "," SimpleArithmeticExpression ")" | "TRIM" "(" [["LEADING" | "TRAILING" | "BOTH"] [char] "FROM"] StringPrimary ")" | "LOWER" "(" StringPrimary ")" | "UPPER" "(" StringPrimary ")"

GroupByClause() public method

GroupByClause ::= "GROUP" "BY" GroupByItem {"," GroupByItem}*
public GroupByClause ( ) : Doctrine\ORM\Query\AST\GroupByClause
return Doctrine\ORM\Query\AST\GroupByClause

GroupByItem() public method

GroupByItem ::= IdentificationVariable | SingleValuedPathExpression
public GroupByItem ( ) : string
return string | \Doctrine\ORM\Query\AST\PathExpression

HavingClause() public method

HavingClause ::= "HAVING" ConditionalExpression
public HavingClause ( ) : Doctrine\ORM\Query\AST\HavingClause
return Doctrine\ORM\Query\AST\HavingClause

IdentificationVariable() public method

IdentificationVariable ::= identifier
public IdentificationVariable ( ) : string
return string

IdentificationVariableDeclaration() public method

IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}*
public IdentificationVariableDeclaration ( ) : Doctrine\ORM\Query\AST\IdentificationVariableDeclaration
return Doctrine\ORM\Query\AST\IdentificationVariableDeclaration

InExpression() public method

InExpression ::= SingleValuedPathExpression ["NOT"] "IN" "(" (InParameter {"," InParameter}* | Subselect) ")"
public InExpression ( ) : Doctrine\ORM\Query\AST\InExpression
return Doctrine\ORM\Query\AST\InExpression

InParameter() public method

InParameter ::= Literal | InputParameter
public InParameter ( ) : string
return string | \Doctrine\ORM\Query\AST\InputParameter

IndexBy() public method

IndexBy ::= "INDEX" "BY" StateFieldPathExpression
public IndexBy ( ) : Doctrine\ORM\Query\AST\IndexBy
return Doctrine\ORM\Query\AST\IndexBy

InputParameter() public method

InputParameter ::= PositionalParameter | NamedParameter
public InputParameter ( ) : Doctrine\ORM\Query\AST\InputParameter
return Doctrine\ORM\Query\AST\InputParameter

InstanceOfExpression() public method

InstanceOfExpression ::= IdentificationVariable ["NOT"] "INSTANCE" ["OF"] (AbstractSchemaName | InputParameter)
public InstanceOfExpression ( ) : Doctrine\ORM\Query\AST\InstanceOfExpression
return Doctrine\ORM\Query\AST\InstanceOfExpression

Join() public method

Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression ["AS"] AliasIdentificationVariable ["WITH" ConditionalExpression]
public Join ( ) : Doctrine\ORM\Query\AST\Join
return Doctrine\ORM\Query\AST\Join

JoinAssociationPathExpression() public method

JoinAssociationPathExpression ::= IdentificationVariable "." (CollectionValuedAssociationField | SingleValuedAssociationField)
public JoinAssociationPathExpression ( ) : Doctrine\ORM\Query\AST\JoinAssociationPathExpression
return Doctrine\ORM\Query\AST\JoinAssociationPathExpression

JoinVariableDeclaration() public method

JoinVariableDeclaration ::= Join [IndexBy]
public JoinVariableDeclaration ( ) : Doctrine\ORM\Query\AST\JoinVariableDeclaration
return Doctrine\ORM\Query\AST\JoinVariableDeclaration

LikeExpression() public method

LikeExpression ::= StringExpression ["NOT"] "LIKE" (string | input_parameter) ["ESCAPE" char]
public LikeExpression ( ) : Doctrine\ORM\Query\AST\LikeExpression
return Doctrine\ORM\Query\AST\LikeExpression

Literal() public method

Literal ::= string | char | integer | float | boolean
public Literal ( ) : string
return string

NewValue() public method

NOTE: Since it is not possible to correctly recognize individual types, here is the full grammar that needs to be supported: NewValue ::= SimpleArithmeticExpression | "NULL" SimpleArithmeticExpression covers all *Primary grammar rules and also SimplEntityExpression
public NewValue ( )

NullComparisonExpression() public method

NullComparisonExpression ::= (SingleValuedPathExpression | InputParameter) "IS" ["NOT"] "NULL"
public NullComparisonExpression ( ) : Doctrine\ORM\Query\AST\NullComparisonExpression
return Doctrine\ORM\Query\AST\NullComparisonExpression

OrderByClause() public method

OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}*
public OrderByClause ( ) : Doctrine\ORM\Query\AST\OrderByClause
return Doctrine\ORM\Query\AST\OrderByClause

OrderByItem() public method

OrderByItem ::= (ResultVariable | StateFieldPathExpression) ["ASC" | "DESC"]
public OrderByItem ( ) : Doctrine\ORM\Query\AST\OrderByItem
return Doctrine\ORM\Query\AST\OrderByItem

PartialObjectExpression() public method

PartialObjectExpression ::= "PARTIAL" IdentificationVariable "." PartialFieldSet PartialFieldSet ::= "{" SimpleStateField {"," SimpleStateField}* "}"
public PartialObjectExpression ( ) : array
return array

PathExpression() public method

PathExpression ::= IdentificationVariable "." identifier
public PathExpression ( integer $expectedTypes ) : Doctrine\ORM\Query\AST\PathExpression
$expectedTypes integer
return Doctrine\ORM\Query\AST\PathExpression

QuantifiedExpression() public method

QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")"
public QuantifiedExpression ( ) : Doctrine\ORM\Query\AST\QuantifiedExpression
return Doctrine\ORM\Query\AST\QuantifiedExpression

QueryLanguage() public method

QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement
public QueryLanguage ( ) : Doctrine\ORM\Query\AST\SelectStatement
return Doctrine\ORM\Query\AST\SelectStatement | \Doctrine\ORM\Query\AST\UpdateStatement | \Doctrine\ORM\Query\AST\DeleteStatement

RangeVariableDeclaration() public method

RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
public RangeVariableDeclaration ( ) : Doctrine\ORM\Query\AST\RangeVariableDeclaration
return Doctrine\ORM\Query\AST\RangeVariableDeclaration

ResultVariable() public method

ResultVariable ::= identifier
public ResultVariable ( ) : string
return string

ScalarExpression() public method

ScalarExpression ::= SimpleArithmeticExpression | StringPrimary | DateTimePrimary | StateFieldPathExpression | BooleanPrimary | CaseExpression | EntityTypeExpression
public ScalarExpression ( ) : mixed
return mixed One of the possible expressions or subexpressions.

SelectClause() public method

SelectClause ::= "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression}
public SelectClause ( ) : Doctrine\ORM\Query\AST\SelectClause
return Doctrine\ORM\Query\AST\SelectClause

SelectExpression() public method

SelectExpression ::= IdentificationVariable | StateFieldPathExpression | (AggregateExpression | "(" Subselect ")" | ScalarExpression) [["AS"] AliasResultVariable]
public SelectExpression ( ) : Doctrine\ORM\Query\AST\SelectExpression
return Doctrine\ORM\Query\AST\SelectExpression

SelectStatement() public method

SelectStatement ::= SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
public SelectStatement ( ) : Doctrine\ORM\Query\AST\SelectStatement
return Doctrine\ORM\Query\AST\SelectStatement

SimpleArithmeticExpression() public method

SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
public SimpleArithmeticExpression ( ) : Doctrine\ORM\Query\AST\SimpleArithmeticExpression
return Doctrine\ORM\Query\AST\SimpleArithmeticExpression

SimpleConditionalExpression() public method

SimpleConditionalExpression ::= ComparisonExpression | BetweenExpression | LikeExpression | InExpression | NullComparisonExpression | ExistsExpression | EmptyCollectionComparisonExpression | CollectionMemberExpression | InstanceOfExpression

SimpleEntityExpression() public method

SimpleEntityExpression ::= IdentificationVariable | InputParameter
public SimpleEntityExpression ( ) : string
return string | \Doctrine\ORM\Query\AST\InputParameter

SimpleSelectClause() public method

SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression
public SimpleSelectClause ( ) : Doctrine\ORM\Query\AST\SimpleSelectClause
return Doctrine\ORM\Query\AST\SimpleSelectClause

SimpleSelectExpression() public method

SimpleSelectExpression ::= StateFieldPathExpression | IdentificationVariable | ((AggregateExpression | "(" Subselect ")" | ScalarExpression) [["AS"] AliasResultVariable])
public SimpleSelectExpression ( ) : Doctrine\ORM\Query\AST\SimpleSelectExpression
return Doctrine\ORM\Query\AST\SimpleSelectExpression

SingleValuedAssociationPathExpression() public method

SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField
public SingleValuedAssociationPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression
return Doctrine\ORM\Query\AST\PathExpression

SingleValuedPathExpression() public method

SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
public SingleValuedPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression
return Doctrine\ORM\Query\AST\PathExpression

StateFieldPathExpression() public method

StateFieldPathExpression ::= IdentificationVariable "." StateField
public StateFieldPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression
return Doctrine\ORM\Query\AST\PathExpression

StringExpression() public method

StringExpression ::= StringPrimary | "(" Subselect ")"
public StringExpression ( ) : Doctrine\ORM\Query\AST\StringPrimary
return Doctrine\ORM\Query\AST\StringPrimary | \Doctrine]ORM\Query\AST\Subselect

StringPrimary() public method

StringPrimary ::= StateFieldPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression
public StringPrimary ( )

Subselect() public method

Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
public Subselect ( ) : Doctrine\ORM\Query\AST\Subselect
return Doctrine\ORM\Query\AST\Subselect

SubselectFromClause() public method

SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}*
public SubselectFromClause ( ) : Doctrine\ORM\Query\AST\SubselectFromClause
return Doctrine\ORM\Query\AST\SubselectFromClause

SubselectIdentificationVariableDeclaration() public method

SubselectIdentificationVariableDeclaration ::= IdentificationVariableDeclaration | (AssociationPathExpression ["AS"] AliasIdentificationVariable)
public SubselectIdentificationVariableDeclaration ( ) : Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration
return Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration | \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration

UpdateClause() public method

UpdateClause ::= "UPDATE" AbstractSchemaName ["AS"] AliasIdentificationVariable "SET" UpdateItem {"," UpdateItem}*
public UpdateClause ( ) : Doctrine\ORM\Query\AST\UpdateClause
return Doctrine\ORM\Query\AST\UpdateClause

UpdateItem() public method

UpdateItem ::= SingleValuedPathExpression "=" NewValue
public UpdateItem ( ) : Doctrine\ORM\Query\AST\UpdateItem
return Doctrine\ORM\Query\AST\UpdateItem

UpdateStatement() public method

UpdateStatement ::= UpdateClause [WhereClause]
public UpdateStatement ( ) : Doctrine\ORM\Query\AST\UpdateStatement
return Doctrine\ORM\Query\AST\UpdateStatement

WhereClause() public method

WhereClause ::= "WHERE" ConditionalExpression
public WhereClause ( ) : Doctrine\ORM\Query\AST\WhereClause
return Doctrine\ORM\Query\AST\WhereClause

__construct() public method

Creates a new query parser object.
public __construct ( Doctrine\ORM\Query $query )
$query Doctrine\ORM\Query The Query to parse.

addCustomTreeWalker() public method

Adds a custom tree walker for modifying the AST.
public addCustomTreeWalker ( string $className )
$className string

free() public method

Free this parser enabling it to be reused
public free ( boolean $deep = false, integer $position )
$deep boolean Whether to clean peek and reset errors
$position integer Position to reset

getAST() public method

Parse and build AST for the given Query.
public getAST ( ) : Doctrine\ORM\Query\AST\SelectStatement
return Doctrine\ORM\Query\AST\SelectStatement | \Doctrine\ORM\Query\AST\UpdateStatement | \Doctrine\ORM\Query\AST\DeleteStatement

getEntityManager() public method

Gets the EntityManager used by the parser.
public getEntityManager ( ) : EntityManager
return EntityManager

getLexer() public method

Gets the lexer used by the parser.
public getLexer ( ) : Doctrine\ORM\Query\Lexer
return Doctrine\ORM\Query\Lexer

getParserResult() public method

Gets the ParserResult that is being filled with information during parsing.
public getParserResult ( ) : Doctrine\ORM\Query\ParserResult
return Doctrine\ORM\Query\ParserResult

match() public method

If they match, updates the lookahead token; otherwise raises a syntax error.
public match ( $token ) : void
return void

parse() public method

Parses a query string.
public parse ( ) : Doctrine\ORM\Query\ParserResult
return Doctrine\ORM\Query\ParserResult

semanticalError() public method

Generates a new semantical error.
public semanticalError ( string $message = '', array $token = null )
$message string Optional message.
$token array Optional token.

setCustomOutputTreeWalker() public method

This tree walker will be run last over the AST, after any other walkers.
public setCustomOutputTreeWalker ( string $className )
$className string

syntaxError() public method

Generates a new syntax error.
public syntaxError ( string $expected = '', array $token = null )
$expected string Expected string.
$token array Got token.