PHP Класс Doctrine\ORM\Query\Parser

Parses a DQL query, reports any errors in it, and generates an AST.
С версии: 2.0
Автор: Guilherme Blanco ([email protected])
Автор: Jonathan Wage ([email protected])
Автор: Roman Borschel ([email protected])
Автор: Janne Vanhala ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
_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.

Описание методов

AbstractSchemaName() публичный метод

AbstractSchemaName ::= identifier
public AbstractSchemaName ( ) : string
Результат string

AggregateExpression() публичный метод

AggregateExpression ::= ("AVG" | "MAX" | "MIN" | "SUM") "(" ["DISTINCT"] StateFieldPathExpression ")" | "COUNT" "(" ["DISTINCT"] (IdentificationVariable | SingleValuedPathExpression) ")"
public AggregateExpression ( ) : Doctrine\ORM\Query\AST\AggregateExpression
Результат Doctrine\ORM\Query\AST\AggregateExpression

AliasIdentificationVariable() публичный метод

AliasIdentificationVariable = identifier
public AliasIdentificationVariable ( ) : string
Результат string

AliasResultVariable() публичный метод

AliasResultVariable ::= identifier
public AliasResultVariable ( ) : string
Результат string

ArithmeticExpression() публичный метод

ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")"
public ArithmeticExpression ( ) : Doctrine\ORM\Query\AST\ArithmeticExpression
Результат Doctrine\ORM\Query\AST\ArithmeticExpression

ArithmeticFactor() публичный метод

ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary
public ArithmeticFactor ( ) : Doctrine\ORM\Query\AST\ArithmeticFactor
Результат Doctrine\ORM\Query\AST\ArithmeticFactor

ArithmeticPrimary() публичный метод

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

ArithmeticTerm() публичный метод

ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}*
public ArithmeticTerm ( ) : Doctrine\ORM\Query\AST\ArithmeticTerm
Результат Doctrine\ORM\Query\AST\ArithmeticTerm

AssociationPathExpression() публичный метод

AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression
public AssociationPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression
Результат Doctrine\ORM\Query\AST\PathExpression

BetweenExpression() публичный метод

BetweenExpression ::= ArithmeticExpression ["NOT"] "BETWEEN" ArithmeticExpression "AND" ArithmeticExpression
public BetweenExpression ( ) : Doctrine\ORM\Query\AST\BetweenExpression
Результат Doctrine\ORM\Query\AST\BetweenExpression

CaseExpression() публичный метод

public CaseExpression ( )

CollectionMemberExpression() публичный метод

EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression SimpleEntityExpression ::= IdentificationVariable | InputParameter
public CollectionMemberExpression ( ) : Doctrine\ORM\Query\AST\CollectionMemberExpression
Результат Doctrine\ORM\Query\AST\CollectionMemberExpression

CollectionValuedPathExpression() публичный метод

CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField
public CollectionValuedPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression
Результат Doctrine\ORM\Query\AST\PathExpression

ComparisonExpression() публичный метод

ComparisonExpression ::= ArithmeticExpression ComparisonOperator ( QuantifiedExpression | ArithmeticExpression )
public ComparisonExpression ( ) : Doctrine\ORM\Query\AST\ComparisonExpression
Результат Doctrine\ORM\Query\AST\ComparisonExpression

ComparisonOperator() публичный метод

ComparisonOperator ::= "=" | "<" | "<=" | "<>" | ">" | ">=" | "!="
public ComparisonOperator ( ) : string
Результат string

ConditionalExpression() публичный метод

ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}*
public ConditionalExpression ( ) : Doctrine\ORM\Query\AST\ConditionalExpression
Результат Doctrine\ORM\Query\AST\ConditionalExpression

ConditionalFactor() публичный метод

ConditionalFactor ::= ["NOT"] ConditionalPrimary
public ConditionalFactor ( ) : Doctrine\ORM\Query\AST\ConditionalFactor
Результат Doctrine\ORM\Query\AST\ConditionalFactor

ConditionalPrimary() публичный метод

ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")"
public ConditionalPrimary ( ) : Doctrine\ORM\Query\AST\ConditionalPrimary
Результат Doctrine\ORM\Query\AST\ConditionalPrimary

ConditionalTerm() публичный метод

ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}*
public ConditionalTerm ( ) : Doctrine\ORM\Query\AST\ConditionalTerm
Результат Doctrine\ORM\Query\AST\ConditionalTerm

CustomFunctionsReturningDatetime() публичный метод

CustomFunctionsReturningNumerics() публичный метод

CustomFunctionsReturningStrings() публичный метод

DeleteClause() публичный метод

DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName ["AS"] AliasIdentificationVariable
public DeleteClause ( ) : Doctrine\ORM\Query\AST\DeleteClause
Результат Doctrine\ORM\Query\AST\DeleteClause

DeleteStatement() публичный метод

DeleteStatement ::= DeleteClause [WhereClause]
public DeleteStatement ( ) : Doctrine\ORM\Query\AST\DeleteStatement
Результат Doctrine\ORM\Query\AST\DeleteStatement

EmptyCollectionComparisonExpression() публичный метод

EmptyCollectionComparisonExpression ::= CollectionValuedPathExpression "IS" ["NOT"] "EMPTY"
public EmptyCollectionComparisonExpression ( ) : Doctrine\ORM\Query\AST\EmptyCollectionComparisonExpression
Результат Doctrine\ORM\Query\AST\EmptyCollectionComparisonExpression

EntityExpression() публичный метод

EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
public EntityExpression ( ) : Doctrine\ORM\Query\AST\SingleValuedAssociationPathExpression
Результат Doctrine\ORM\Query\AST\SingleValuedAssociationPathExpression | \Doctrine\ORM\Query\AST\SimpleEntityExpression

ExistsExpression() публичный метод

ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")"
public ExistsExpression ( ) : Doctrine\ORM\Query\AST\ExistsExpression
Результат Doctrine\ORM\Query\AST\ExistsExpression

FromClause() публичный метод

FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration}*
public FromClause ( ) : Doctrine\ORM\Query\AST\FromClause
Результат Doctrine\ORM\Query\AST\FromClause

FunctionDeclaration() публичный метод

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

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() публичный метод

GroupByClause ::= "GROUP" "BY" GroupByItem {"," GroupByItem}*
public GroupByClause ( ) : Doctrine\ORM\Query\AST\GroupByClause
Результат Doctrine\ORM\Query\AST\GroupByClause

GroupByItem() публичный метод

GroupByItem ::= IdentificationVariable | SingleValuedPathExpression
public GroupByItem ( ) : string
Результат string | \Doctrine\ORM\Query\AST\PathExpression

HavingClause() публичный метод

HavingClause ::= "HAVING" ConditionalExpression
public HavingClause ( ) : Doctrine\ORM\Query\AST\HavingClause
Результат Doctrine\ORM\Query\AST\HavingClause

IdentificationVariable() публичный метод

IdentificationVariable ::= identifier
public IdentificationVariable ( ) : string
Результат string

IdentificationVariableDeclaration() публичный метод

IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}*
public IdentificationVariableDeclaration ( ) : Doctrine\ORM\Query\AST\IdentificationVariableDeclaration
Результат Doctrine\ORM\Query\AST\IdentificationVariableDeclaration

InExpression() публичный метод

InExpression ::= SingleValuedPathExpression ["NOT"] "IN" "(" (InParameter {"," InParameter}* | Subselect) ")"
public InExpression ( ) : Doctrine\ORM\Query\AST\InExpression
Результат Doctrine\ORM\Query\AST\InExpression

InParameter() публичный метод

InParameter ::= Literal | InputParameter
public InParameter ( ) : string
Результат string | \Doctrine\ORM\Query\AST\InputParameter

IndexBy() публичный метод

IndexBy ::= "INDEX" "BY" StateFieldPathExpression
public IndexBy ( ) : Doctrine\ORM\Query\AST\IndexBy
Результат Doctrine\ORM\Query\AST\IndexBy

InputParameter() публичный метод

InputParameter ::= PositionalParameter | NamedParameter
public InputParameter ( ) : Doctrine\ORM\Query\AST\InputParameter
Результат Doctrine\ORM\Query\AST\InputParameter

InstanceOfExpression() публичный метод

InstanceOfExpression ::= IdentificationVariable ["NOT"] "INSTANCE" ["OF"] (AbstractSchemaName | InputParameter)
public InstanceOfExpression ( ) : Doctrine\ORM\Query\AST\InstanceOfExpression
Результат Doctrine\ORM\Query\AST\InstanceOfExpression

Join() публичный метод

Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression ["AS"] AliasIdentificationVariable ["WITH" ConditionalExpression]
public Join ( ) : Doctrine\ORM\Query\AST\Join
Результат Doctrine\ORM\Query\AST\Join

JoinAssociationPathExpression() публичный метод

JoinAssociationPathExpression ::= IdentificationVariable "." (CollectionValuedAssociationField | SingleValuedAssociationField)
public JoinAssociationPathExpression ( ) : Doctrine\ORM\Query\AST\JoinAssociationPathExpression
Результат Doctrine\ORM\Query\AST\JoinAssociationPathExpression

JoinVariableDeclaration() публичный метод

JoinVariableDeclaration ::= Join [IndexBy]
public JoinVariableDeclaration ( ) : Doctrine\ORM\Query\AST\JoinVariableDeclaration
Результат Doctrine\ORM\Query\AST\JoinVariableDeclaration

LikeExpression() публичный метод

LikeExpression ::= StringExpression ["NOT"] "LIKE" (string | input_parameter) ["ESCAPE" char]
public LikeExpression ( ) : Doctrine\ORM\Query\AST\LikeExpression
Результат Doctrine\ORM\Query\AST\LikeExpression

Literal() публичный метод

Literal ::= string | char | integer | float | boolean
public Literal ( ) : string
Результат string

NewValue() публичный метод

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() публичный метод

NullComparisonExpression ::= (SingleValuedPathExpression | InputParameter) "IS" ["NOT"] "NULL"
public NullComparisonExpression ( ) : Doctrine\ORM\Query\AST\NullComparisonExpression
Результат Doctrine\ORM\Query\AST\NullComparisonExpression

OrderByClause() публичный метод

OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}*
public OrderByClause ( ) : Doctrine\ORM\Query\AST\OrderByClause
Результат Doctrine\ORM\Query\AST\OrderByClause

OrderByItem() публичный метод

OrderByItem ::= (ResultVariable | StateFieldPathExpression) ["ASC" | "DESC"]
public OrderByItem ( ) : Doctrine\ORM\Query\AST\OrderByItem
Результат Doctrine\ORM\Query\AST\OrderByItem

PartialObjectExpression() публичный метод

PartialObjectExpression ::= "PARTIAL" IdentificationVariable "." PartialFieldSet PartialFieldSet ::= "{" SimpleStateField {"," SimpleStateField}* "}"
public PartialObjectExpression ( ) : array
Результат array

PathExpression() публичный метод

PathExpression ::= IdentificationVariable "." identifier
public PathExpression ( integer $expectedTypes ) : Doctrine\ORM\Query\AST\PathExpression
$expectedTypes integer
Результат Doctrine\ORM\Query\AST\PathExpression

QuantifiedExpression() публичный метод

QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")"
public QuantifiedExpression ( ) : Doctrine\ORM\Query\AST\QuantifiedExpression
Результат Doctrine\ORM\Query\AST\QuantifiedExpression

QueryLanguage() публичный метод

QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement
public QueryLanguage ( ) : Doctrine\ORM\Query\AST\SelectStatement
Результат Doctrine\ORM\Query\AST\SelectStatement | \Doctrine\ORM\Query\AST\UpdateStatement | \Doctrine\ORM\Query\AST\DeleteStatement

RangeVariableDeclaration() публичный метод

RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
public RangeVariableDeclaration ( ) : Doctrine\ORM\Query\AST\RangeVariableDeclaration
Результат Doctrine\ORM\Query\AST\RangeVariableDeclaration

ResultVariable() публичный метод

ResultVariable ::= identifier
public ResultVariable ( ) : string
Результат string

ScalarExpression() публичный метод

ScalarExpression ::= SimpleArithmeticExpression | StringPrimary | DateTimePrimary | StateFieldPathExpression | BooleanPrimary | CaseExpression | EntityTypeExpression
public ScalarExpression ( ) : mixed
Результат mixed One of the possible expressions or subexpressions.

SelectClause() публичный метод

SelectClause ::= "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression}
public SelectClause ( ) : Doctrine\ORM\Query\AST\SelectClause
Результат Doctrine\ORM\Query\AST\SelectClause

SelectExpression() публичный метод

SelectExpression ::= IdentificationVariable | StateFieldPathExpression | (AggregateExpression | "(" Subselect ")" | ScalarExpression) [["AS"] AliasResultVariable]
public SelectExpression ( ) : Doctrine\ORM\Query\AST\SelectExpression
Результат Doctrine\ORM\Query\AST\SelectExpression

SelectStatement() публичный метод

SelectStatement ::= SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
public SelectStatement ( ) : Doctrine\ORM\Query\AST\SelectStatement
Результат Doctrine\ORM\Query\AST\SelectStatement

SimpleArithmeticExpression() публичный метод

SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
public SimpleArithmeticExpression ( ) : Doctrine\ORM\Query\AST\SimpleArithmeticExpression
Результат Doctrine\ORM\Query\AST\SimpleArithmeticExpression

SimpleConditionalExpression() публичный метод

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

SimpleEntityExpression() публичный метод

SimpleEntityExpression ::= IdentificationVariable | InputParameter
public SimpleEntityExpression ( ) : string
Результат string | \Doctrine\ORM\Query\AST\InputParameter

SimpleSelectClause() публичный метод

SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression
public SimpleSelectClause ( ) : Doctrine\ORM\Query\AST\SimpleSelectClause
Результат Doctrine\ORM\Query\AST\SimpleSelectClause

SimpleSelectExpression() публичный метод

SimpleSelectExpression ::= StateFieldPathExpression | IdentificationVariable | ((AggregateExpression | "(" Subselect ")" | ScalarExpression) [["AS"] AliasResultVariable])
public SimpleSelectExpression ( ) : Doctrine\ORM\Query\AST\SimpleSelectExpression
Результат Doctrine\ORM\Query\AST\SimpleSelectExpression

SingleValuedAssociationPathExpression() публичный метод

SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField
public SingleValuedAssociationPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression
Результат Doctrine\ORM\Query\AST\PathExpression

SingleValuedPathExpression() публичный метод

SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
public SingleValuedPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression
Результат Doctrine\ORM\Query\AST\PathExpression

StateFieldPathExpression() публичный метод

StateFieldPathExpression ::= IdentificationVariable "." StateField
public StateFieldPathExpression ( ) : Doctrine\ORM\Query\AST\PathExpression
Результат Doctrine\ORM\Query\AST\PathExpression

StringExpression() публичный метод

StringExpression ::= StringPrimary | "(" Subselect ")"
public StringExpression ( ) : Doctrine\ORM\Query\AST\StringPrimary
Результат Doctrine\ORM\Query\AST\StringPrimary | \Doctrine]ORM\Query\AST\Subselect

StringPrimary() публичный метод

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

Subselect() публичный метод

Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
public Subselect ( ) : Doctrine\ORM\Query\AST\Subselect
Результат Doctrine\ORM\Query\AST\Subselect

SubselectFromClause() публичный метод

SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}*
public SubselectFromClause ( ) : Doctrine\ORM\Query\AST\SubselectFromClause
Результат Doctrine\ORM\Query\AST\SubselectFromClause

SubselectIdentificationVariableDeclaration() публичный метод

SubselectIdentificationVariableDeclaration ::= IdentificationVariableDeclaration | (AssociationPathExpression ["AS"] AliasIdentificationVariable)
public SubselectIdentificationVariableDeclaration ( ) : Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration
Результат Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration | \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration

UpdateClause() публичный метод

UpdateClause ::= "UPDATE" AbstractSchemaName ["AS"] AliasIdentificationVariable "SET" UpdateItem {"," UpdateItem}*
public UpdateClause ( ) : Doctrine\ORM\Query\AST\UpdateClause
Результат Doctrine\ORM\Query\AST\UpdateClause

UpdateItem() публичный метод

UpdateItem ::= SingleValuedPathExpression "=" NewValue
public UpdateItem ( ) : Doctrine\ORM\Query\AST\UpdateItem
Результат Doctrine\ORM\Query\AST\UpdateItem

UpdateStatement() публичный метод

UpdateStatement ::= UpdateClause [WhereClause]
public UpdateStatement ( ) : Doctrine\ORM\Query\AST\UpdateStatement
Результат Doctrine\ORM\Query\AST\UpdateStatement

WhereClause() публичный метод

WhereClause ::= "WHERE" ConditionalExpression
public WhereClause ( ) : Doctrine\ORM\Query\AST\WhereClause
Результат Doctrine\ORM\Query\AST\WhereClause

__construct() публичный метод

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

addCustomTreeWalker() публичный метод

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

free() публичный метод

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() публичный метод

Parse and build AST for the given Query.
public getAST ( ) : Doctrine\ORM\Query\AST\SelectStatement
Результат Doctrine\ORM\Query\AST\SelectStatement | \Doctrine\ORM\Query\AST\UpdateStatement | \Doctrine\ORM\Query\AST\DeleteStatement

getEntityManager() публичный метод

Gets the EntityManager used by the parser.
public getEntityManager ( ) : EntityManager
Результат EntityManager

getLexer() публичный метод

Gets the lexer used by the parser.
public getLexer ( ) : Doctrine\ORM\Query\Lexer
Результат Doctrine\ORM\Query\Lexer

getParserResult() публичный метод

Gets the ParserResult that is being filled with information during parsing.
public getParserResult ( ) : Doctrine\ORM\Query\ParserResult
Результат Doctrine\ORM\Query\ParserResult

match() публичный метод

If they match, updates the lookahead token; otherwise raises a syntax error.
public match ( $token ) : void
Результат void

parse() публичный метод

Parses a query string.
public parse ( ) : Doctrine\ORM\Query\ParserResult
Результат Doctrine\ORM\Query\ParserResult

semanticalError() публичный метод

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

setCustomOutputTreeWalker() публичный метод

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

syntaxError() публичный метод

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