[2.0] Some docblocks inclusion.
This commit is contained in:
parent
b2b06554b4
commit
c71c55f2e7
@ -272,6 +272,8 @@ class Parser
|
|||||||
*
|
*
|
||||||
* @param string $expected Optional expected string.
|
* @param string $expected Optional expected string.
|
||||||
* @param array $token Optional token.
|
* @param array $token Optional token.
|
||||||
|
*
|
||||||
|
* @throws \Doctrine\ORM\Query\QueryException
|
||||||
*/
|
*/
|
||||||
public function syntaxError($expected = '', $token = null)
|
public function syntaxError($expected = '', $token = null)
|
||||||
{
|
{
|
||||||
@ -302,6 +304,8 @@ class Parser
|
|||||||
*
|
*
|
||||||
* @param string $message Optional message.
|
* @param string $message Optional message.
|
||||||
* @param array $token Optional token.
|
* @param array $token Optional token.
|
||||||
|
*
|
||||||
|
* @throws \Doctrine\ORM\Query\QueryException
|
||||||
*/
|
*/
|
||||||
public function semanticalError($message = '', $token = null)
|
public function semanticalError($message = '', $token = null)
|
||||||
{
|
{
|
||||||
@ -563,6 +567,10 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement
|
* QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\SelectStatement |
|
||||||
|
* \Doctrine\ORM\Query\AST\UpdateStatement |
|
||||||
|
* \Doctrine\ORM\Query\AST\DeleteStatement
|
||||||
*/
|
*/
|
||||||
public function QueryLanguage()
|
public function QueryLanguage()
|
||||||
{
|
{
|
||||||
@ -587,6 +595,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SelectStatement ::= SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
|
* SelectStatement ::= SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\SelectStatement
|
||||||
*/
|
*/
|
||||||
public function SelectStatement()
|
public function SelectStatement()
|
||||||
{
|
{
|
||||||
@ -619,6 +629,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* UpdateStatement ::= UpdateClause [WhereClause]
|
* UpdateStatement ::= UpdateClause [WhereClause]
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\UpdateStatement
|
||||||
*/
|
*/
|
||||||
public function UpdateStatement()
|
public function UpdateStatement()
|
||||||
{
|
{
|
||||||
@ -632,6 +644,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* DeleteStatement ::= DeleteClause [WhereClause]
|
* DeleteStatement ::= DeleteClause [WhereClause]
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\DeleteStatement
|
||||||
*/
|
*/
|
||||||
public function DeleteStatement()
|
public function DeleteStatement()
|
||||||
{
|
{
|
||||||
@ -646,6 +660,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* IdentificationVariable ::= identifier
|
* IdentificationVariable ::= identifier
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function IdentificationVariable()
|
public function IdentificationVariable()
|
||||||
{
|
{
|
||||||
@ -656,6 +672,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* AliasIdentificationVariable = identifier
|
* AliasIdentificationVariable = identifier
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function AliasIdentificationVariable()
|
public function AliasIdentificationVariable()
|
||||||
{
|
{
|
||||||
@ -666,6 +684,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* AbstractSchemaName ::= identifier
|
* AbstractSchemaName ::= identifier
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function AbstractSchemaName()
|
public function AbstractSchemaName()
|
||||||
{
|
{
|
||||||
@ -676,6 +696,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ResultVariable ::= identifier
|
* ResultVariable ::= identifier
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function ResultVariable()
|
public function ResultVariable()
|
||||||
{
|
{
|
||||||
@ -687,6 +709,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* JoinAssociationPathExpression ::= IdentificationVariable "." (CollectionValuedAssociationField | SingleValuedAssociationField)
|
* JoinAssociationPathExpression ::= IdentificationVariable "." (CollectionValuedAssociationField | SingleValuedAssociationField)
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\JoinAssociationPathExpression
|
||||||
*/
|
*/
|
||||||
public function JoinAssociationPathExpression()
|
public function JoinAssociationPathExpression()
|
||||||
{
|
{
|
||||||
@ -715,7 +739,7 @@ class Parser
|
|||||||
* PathExpression ::= IdentificationVariable "." {identifier "."}* identifier
|
* PathExpression ::= IdentificationVariable "." {identifier "."}* identifier
|
||||||
*
|
*
|
||||||
* @param integer $expectedType
|
* @param integer $expectedType
|
||||||
* @return AST\PathExpression
|
* @return \Doctrine\ORM\Query\AST\PathExpression
|
||||||
*/
|
*/
|
||||||
public function PathExpression($expectedType)
|
public function PathExpression($expectedType)
|
||||||
{
|
{
|
||||||
@ -749,6 +773,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression
|
* AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\PathExpression
|
||||||
*/
|
*/
|
||||||
public function AssociationPathExpression()
|
public function AssociationPathExpression()
|
||||||
{
|
{
|
||||||
@ -760,6 +786,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
|
* SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\PathExpression
|
||||||
*/
|
*/
|
||||||
public function SingleValuedPathExpression()
|
public function SingleValuedPathExpression()
|
||||||
{
|
{
|
||||||
@ -771,6 +799,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* StateFieldPathExpression ::= SimpleStateFieldPathExpression | SimpleStateFieldAssociationPathExpression
|
* StateFieldPathExpression ::= SimpleStateFieldPathExpression | SimpleStateFieldAssociationPathExpression
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\PathExpression
|
||||||
*/
|
*/
|
||||||
public function StateFieldPathExpression()
|
public function StateFieldPathExpression()
|
||||||
{
|
{
|
||||||
@ -779,6 +809,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SingleValuedAssociationPathExpression ::= IdentificationVariable "." {SingleValuedAssociationField "."}* SingleValuedAssociationField
|
* SingleValuedAssociationPathExpression ::= IdentificationVariable "." {SingleValuedAssociationField "."}* SingleValuedAssociationField
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\PathExpression
|
||||||
*/
|
*/
|
||||||
public function SingleValuedAssociationPathExpression()
|
public function SingleValuedAssociationPathExpression()
|
||||||
{
|
{
|
||||||
@ -787,6 +819,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* CollectionValuedPathExpression ::= IdentificationVariable "." {SingleValuedAssociationField "."}* CollectionValuedAssociationField
|
* CollectionValuedPathExpression ::= IdentificationVariable "." {SingleValuedAssociationField "."}* CollectionValuedAssociationField
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\PathExpression
|
||||||
*/
|
*/
|
||||||
public function CollectionValuedPathExpression()
|
public function CollectionValuedPathExpression()
|
||||||
{
|
{
|
||||||
@ -795,6 +829,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SimpleStateFieldPathExpression ::= IdentificationVariable "." StateField
|
* SimpleStateFieldPathExpression ::= IdentificationVariable "." StateField
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\PathExpression
|
||||||
*/
|
*/
|
||||||
public function SimpleStateFieldPathExpression()
|
public function SimpleStateFieldPathExpression()
|
||||||
{
|
{
|
||||||
@ -814,6 +850,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SelectClause ::= "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression}
|
* SelectClause ::= "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression}
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\SelectClause
|
||||||
*/
|
*/
|
||||||
public function SelectClause()
|
public function SelectClause()
|
||||||
{
|
{
|
||||||
@ -840,6 +878,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression
|
* SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\SimpleSelectClause
|
||||||
*/
|
*/
|
||||||
public function SimpleSelectClause()
|
public function SimpleSelectClause()
|
||||||
{
|
{
|
||||||
@ -859,6 +899,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* UpdateClause ::= "UPDATE" AbstractSchemaName [["AS"] AliasIdentificationVariable] "SET" UpdateItem {"," UpdateItem}*
|
* UpdateClause ::= "UPDATE" AbstractSchemaName [["AS"] AliasIdentificationVariable] "SET" UpdateItem {"," UpdateItem}*
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\UpdateClause
|
||||||
*/
|
*/
|
||||||
public function UpdateClause()
|
public function UpdateClause()
|
||||||
{
|
{
|
||||||
@ -904,6 +946,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName [["AS"] AliasIdentificationVariable]
|
* DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName [["AS"] AliasIdentificationVariable]
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\DeleteClause
|
||||||
*/
|
*/
|
||||||
public function DeleteClause()
|
public function DeleteClause()
|
||||||
{
|
{
|
||||||
@ -939,6 +983,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration}*
|
* FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration}*
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\FromClause
|
||||||
*/
|
*/
|
||||||
public function FromClause()
|
public function FromClause()
|
||||||
{
|
{
|
||||||
@ -956,6 +1002,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}*
|
* SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}*
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\SubselectFromClause
|
||||||
*/
|
*/
|
||||||
public function SubselectFromClause()
|
public function SubselectFromClause()
|
||||||
{
|
{
|
||||||
@ -973,6 +1021,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* WhereClause ::= "WHERE" ConditionalExpression
|
* WhereClause ::= "WHERE" ConditionalExpression
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\WhereClause
|
||||||
*/
|
*/
|
||||||
public function WhereClause()
|
public function WhereClause()
|
||||||
{
|
{
|
||||||
@ -983,6 +1033,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* HavingClause ::= "HAVING" ConditionalExpression
|
* HavingClause ::= "HAVING" ConditionalExpression
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\HavingClause
|
||||||
*/
|
*/
|
||||||
public function HavingClause()
|
public function HavingClause()
|
||||||
{
|
{
|
||||||
@ -993,6 +1045,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* GroupByClause ::= "GROUP" "BY" GroupByItem {"," GroupByItem}*
|
* GroupByClause ::= "GROUP" "BY" GroupByItem {"," GroupByItem}*
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\GroupByClause
|
||||||
*/
|
*/
|
||||||
public function GroupByClause()
|
public function GroupByClause()
|
||||||
{
|
{
|
||||||
@ -1011,6 +1065,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}*
|
* OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}*
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\OrderByClause
|
||||||
*/
|
*/
|
||||||
public function OrderByClause()
|
public function OrderByClause()
|
||||||
{
|
{
|
||||||
@ -1030,6 +1086,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
|
* Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\Subselect
|
||||||
*/
|
*/
|
||||||
public function Subselect()
|
public function Subselect()
|
||||||
{
|
{
|
||||||
@ -1059,6 +1117,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* UpdateItem ::= [IdentificationVariable "."] {StateField | SingleValuedAssociationField} "=" NewValue
|
* UpdateItem ::= [IdentificationVariable "."] {StateField | SingleValuedAssociationField} "=" NewValue
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\UpdateItem
|
||||||
*/
|
*/
|
||||||
public function UpdateItem()
|
public function UpdateItem()
|
||||||
{
|
{
|
||||||
@ -1088,6 +1148,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* GroupByItem ::= IdentificationVariable | SingleValuedPathExpression
|
* GroupByItem ::= IdentificationVariable | SingleValuedPathExpression
|
||||||
|
*
|
||||||
|
* @return string | \Doctrine\ORM\Query\AST\PathExpression
|
||||||
*/
|
*/
|
||||||
public function GroupByItem()
|
public function GroupByItem()
|
||||||
{
|
{
|
||||||
@ -1111,6 +1173,8 @@ class Parser
|
|||||||
*
|
*
|
||||||
* @todo Post 2.0 release. Support general SingleValuedPathExpression instead
|
* @todo Post 2.0 release. Support general SingleValuedPathExpression instead
|
||||||
* of only StateFieldPathExpression.
|
* of only StateFieldPathExpression.
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\OrderByItem
|
||||||
*/
|
*/
|
||||||
public function OrderByItem()
|
public function OrderByItem()
|
||||||
{
|
{
|
||||||
@ -1174,6 +1238,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}*
|
* IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}*
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration
|
||||||
*/
|
*/
|
||||||
public function IdentificationVariableDeclaration()
|
public function IdentificationVariableDeclaration()
|
||||||
{
|
{
|
||||||
@ -1196,6 +1262,9 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SubselectIdentificationVariableDeclaration ::= IdentificationVariableDeclaration | (AssociationPathExpression ["AS"] AliasIdentificationVariable)
|
* SubselectIdentificationVariableDeclaration ::= IdentificationVariableDeclaration | (AssociationPathExpression ["AS"] AliasIdentificationVariable)
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration |
|
||||||
|
* \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration
|
||||||
*/
|
*/
|
||||||
public function SubselectIdentificationVariableDeclaration()
|
public function SubselectIdentificationVariableDeclaration()
|
||||||
{
|
{
|
||||||
@ -1215,6 +1284,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* JoinVariableDeclaration ::= Join [IndexBy]
|
* JoinVariableDeclaration ::= Join [IndexBy]
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\JoinVariableDeclaration
|
||||||
*/
|
*/
|
||||||
public function JoinVariableDeclaration()
|
public function JoinVariableDeclaration()
|
||||||
{
|
{
|
||||||
@ -1227,6 +1298,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
|
* RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\RangeVariableDeclaration
|
||||||
*/
|
*/
|
||||||
public function RangeVariableDeclaration()
|
public function RangeVariableDeclaration()
|
||||||
{
|
{
|
||||||
@ -1256,6 +1329,8 @@ class Parser
|
|||||||
/**
|
/**
|
||||||
* Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression
|
* Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression
|
||||||
* ["AS"] AliasIdentificationVariable [("ON" | "WITH") ConditionalExpression]
|
* ["AS"] AliasIdentificationVariable [("ON" | "WITH") ConditionalExpression]
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\Join
|
||||||
*/
|
*/
|
||||||
public function Join()
|
public function Join()
|
||||||
{
|
{
|
||||||
@ -1326,6 +1401,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* IndexBy ::= "INDEX" "BY" SimpleStateFieldPathExpression
|
* IndexBy ::= "INDEX" "BY" SimpleStateFieldPathExpression
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\IndexBy
|
||||||
*/
|
*/
|
||||||
public function IndexBy()
|
public function IndexBy()
|
||||||
{
|
{
|
||||||
@ -1345,6 +1422,8 @@ class Parser
|
|||||||
* SelectExpression ::=
|
* SelectExpression ::=
|
||||||
* IdentificationVariable | StateFieldPathExpression |
|
* IdentificationVariable | StateFieldPathExpression |
|
||||||
* (AggregateExpression | "(" Subselect ")" | FunctionDeclaration) [["AS"] ResultVariable]
|
* (AggregateExpression | "(" Subselect ")" | FunctionDeclaration) [["AS"] ResultVariable]
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\SelectExpression
|
||||||
*/
|
*/
|
||||||
public function SelectExpression()
|
public function SelectExpression()
|
||||||
{
|
{
|
||||||
@ -1398,6 +1477,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SimpleSelectExpression ::= StateFieldPathExpression | IdentificationVariable | (AggregateExpression [["AS"] ResultVariable])
|
* SimpleSelectExpression ::= StateFieldPathExpression | IdentificationVariable | (AggregateExpression [["AS"] ResultVariable])
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\SimpleSelectExpression
|
||||||
*/
|
*/
|
||||||
public function SimpleSelectExpression()
|
public function SimpleSelectExpression()
|
||||||
{
|
{
|
||||||
@ -1412,30 +1493,32 @@ class Parser
|
|||||||
$this->match($this->_lexer->lookahead['value']);
|
$this->match($this->_lexer->lookahead['value']);
|
||||||
|
|
||||||
return new AST\SimpleSelectExpression($this->_lexer->token['value']);
|
return new AST\SimpleSelectExpression($this->_lexer->token['value']);
|
||||||
} else {
|
|
||||||
$expr = new AST\SimpleSelectExpression($this->AggregateExpression());
|
|
||||||
|
|
||||||
if ($this->_lexer->isNextToken(Lexer::T_AS)) {
|
|
||||||
$this->match(Lexer::T_AS);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->_lexer->isNextToken(Lexer::T_IDENTIFIER)) {
|
|
||||||
$resultVariable = $this->ResultVariable();
|
|
||||||
$expr->setFieldIdentificationVariable($resultVariable);
|
|
||||||
|
|
||||||
// Include ResultVariable in query components.
|
|
||||||
$this->_queryComponents[$resultVariable] = array(
|
|
||||||
'resultvariable' => $expr
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $expr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$expr = new AST\SimpleSelectExpression($this->AggregateExpression());
|
||||||
|
|
||||||
|
if ($this->_lexer->isNextToken(Lexer::T_AS)) {
|
||||||
|
$this->match(Lexer::T_AS);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->_lexer->isNextToken(Lexer::T_IDENTIFIER)) {
|
||||||
|
$resultVariable = $this->ResultVariable();
|
||||||
|
$expr->setFieldIdentificationVariable($resultVariable);
|
||||||
|
|
||||||
|
// Include ResultVariable in query components.
|
||||||
|
$this->_queryComponents[$resultVariable] = array(
|
||||||
|
'resultvariable' => $expr
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $expr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}*
|
* ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}*
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\ConditionalExpression
|
||||||
*/
|
*/
|
||||||
public function ConditionalExpression()
|
public function ConditionalExpression()
|
||||||
{
|
{
|
||||||
@ -1452,6 +1535,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}*
|
* ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}*
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\ConditionalTerm
|
||||||
*/
|
*/
|
||||||
public function ConditionalTerm()
|
public function ConditionalTerm()
|
||||||
{
|
{
|
||||||
@ -1468,6 +1553,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ConditionalFactor ::= ["NOT"] ConditionalPrimary
|
* ConditionalFactor ::= ["NOT"] ConditionalPrimary
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\ConditionalFactor
|
||||||
*/
|
*/
|
||||||
public function ConditionalFactor()
|
public function ConditionalFactor()
|
||||||
{
|
{
|
||||||
@ -1483,6 +1570,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")"
|
* ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")"
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\ConditionalPrimary
|
||||||
*/
|
*/
|
||||||
public function ConditionalPrimary()
|
public function ConditionalPrimary()
|
||||||
{
|
{
|
||||||
@ -1587,9 +1676,9 @@ class Parser
|
|||||||
default:
|
default:
|
||||||
$this->syntaxError();
|
$this->syntaxError();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return $this->ComparisonExpression();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this->ComparisonExpression();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1599,7 +1688,7 @@ class Parser
|
|||||||
* EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
|
* EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
|
||||||
* SimpleEntityExpression ::= IdentificationVariable | InputParameter
|
* SimpleEntityExpression ::= IdentificationVariable | InputParameter
|
||||||
*
|
*
|
||||||
* @return AST\CollectionMemberExpression
|
* @return \Doctrine\ORM\Query\AST\CollectionMemberExpression
|
||||||
*/
|
*/
|
||||||
public function CollectionMemberExpression()
|
public function CollectionMemberExpression()
|
||||||
{
|
{
|
||||||
@ -1652,6 +1741,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")"
|
* ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")"
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\ArithmeticExpression
|
||||||
*/
|
*/
|
||||||
public function ArithmeticExpression()
|
public function ArithmeticExpression()
|
||||||
{
|
{
|
||||||
@ -1676,6 +1767,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
|
* SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\SimpleArithmeticExpression
|
||||||
*/
|
*/
|
||||||
public function SimpleArithmeticExpression()
|
public function SimpleArithmeticExpression()
|
||||||
{
|
{
|
||||||
@ -1698,6 +1791,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}*
|
* ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}*
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\ArithmeticTerm
|
||||||
*/
|
*/
|
||||||
public function ArithmeticTerm()
|
public function ArithmeticTerm()
|
||||||
{
|
{
|
||||||
@ -1720,6 +1815,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary
|
* ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\ArithmeticFactor
|
||||||
*/
|
*/
|
||||||
public function ArithmeticFactor()
|
public function ArithmeticFactor()
|
||||||
{
|
{
|
||||||
@ -1786,15 +1883,19 @@ class Parser
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->FunctionsReturningStrings();
|
return $this->FunctionsReturningStrings();
|
||||||
} else {
|
|
||||||
$this->syntaxError();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->syntaxError();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StringExpression ::= StringPrimary | "(" Subselect ")"
|
* StringExpression ::= StringPrimary | "(" Subselect ")"
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\StringPrimary |
|
||||||
|
* \Doctrine]ORM\Query\AST\Subselect
|
||||||
*/
|
*/
|
||||||
public function StringExpression()
|
public function StringExpression()
|
||||||
{
|
{
|
||||||
@ -1845,6 +1946,9 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
|
* EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\SingleValuedAssociationPathExpression |
|
||||||
|
* \Doctrine\ORM\Query\AST\SimpleEntityExpression
|
||||||
*/
|
*/
|
||||||
public function EntityExpression()
|
public function EntityExpression()
|
||||||
{
|
{
|
||||||
@ -1859,6 +1963,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SimpleEntityExpression ::= IdentificationVariable | InputParameter
|
* SimpleEntityExpression ::= IdentificationVariable | InputParameter
|
||||||
|
*
|
||||||
|
* @return string | \Doctrine\ORM\Query\AST\InputParameter
|
||||||
*/
|
*/
|
||||||
public function SimpleEntityExpression()
|
public function SimpleEntityExpression()
|
||||||
{
|
{
|
||||||
@ -1875,6 +1981,8 @@ class Parser
|
|||||||
* AggregateExpression ::=
|
* AggregateExpression ::=
|
||||||
* ("AVG" | "MAX" | "MIN" | "SUM") "(" ["DISTINCT"] StateFieldPathExpression ")" |
|
* ("AVG" | "MAX" | "MIN" | "SUM") "(" ["DISTINCT"] StateFieldPathExpression ")" |
|
||||||
* "COUNT" "(" ["DISTINCT"] (IdentificationVariable | SingleValuedPathExpression) ")"
|
* "COUNT" "(" ["DISTINCT"] (IdentificationVariable | SingleValuedPathExpression) ")"
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\AggregateExpression
|
||||||
*/
|
*/
|
||||||
public function AggregateExpression()
|
public function AggregateExpression()
|
||||||
{
|
{
|
||||||
@ -1918,6 +2026,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")"
|
* QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")"
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\QuantifiedExpression
|
||||||
*/
|
*/
|
||||||
public function QuantifiedExpression()
|
public function QuantifiedExpression()
|
||||||
{
|
{
|
||||||
@ -1949,6 +2059,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* BetweenExpression ::= ArithmeticExpression ["NOT"] "BETWEEN" ArithmeticExpression "AND" ArithmeticExpression
|
* BetweenExpression ::= ArithmeticExpression ["NOT"] "BETWEEN" ArithmeticExpression "AND" ArithmeticExpression
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\BetweenExpression
|
||||||
*/
|
*/
|
||||||
public function BetweenExpression()
|
public function BetweenExpression()
|
||||||
{
|
{
|
||||||
@ -1976,6 +2088,8 @@ class Parser
|
|||||||
*
|
*
|
||||||
* @return AST\ComparisonExpression
|
* @return AST\ComparisonExpression
|
||||||
* @todo Semantical checks whether $leftExpr $operator and $rightExpr are compatible.
|
* @todo Semantical checks whether $leftExpr $operator and $rightExpr are compatible.
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\ComparisonExpression
|
||||||
*/
|
*/
|
||||||
public function ComparisonExpression()
|
public function ComparisonExpression()
|
||||||
{
|
{
|
||||||
@ -1995,6 +2109,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* InExpression ::= StateFieldPathExpression ["NOT"] "IN" "(" (Literal {"," Literal}* | Subselect) ")"
|
* InExpression ::= StateFieldPathExpression ["NOT"] "IN" "(" (Literal {"," Literal}* | Subselect) ")"
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\InExpression
|
||||||
*/
|
*/
|
||||||
public function InExpression()
|
public function InExpression()
|
||||||
{
|
{
|
||||||
@ -2029,6 +2145,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* LikeExpression ::= StringExpression ["NOT"] "LIKE" (string | input_parameter) ["ESCAPE" char]
|
* LikeExpression ::= StringExpression ["NOT"] "LIKE" (string | input_parameter) ["ESCAPE" char]
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\LikeExpression
|
||||||
*/
|
*/
|
||||||
public function LikeExpression()
|
public function LikeExpression()
|
||||||
{
|
{
|
||||||
@ -2063,6 +2181,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* NullComparisonExpression ::= (SingleValuedPathExpression | InputParameter) "IS" ["NOT"] "NULL"
|
* NullComparisonExpression ::= (SingleValuedPathExpression | InputParameter) "IS" ["NOT"] "NULL"
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\NullComparisonExpression
|
||||||
*/
|
*/
|
||||||
public function NullComparisonExpression()
|
public function NullComparisonExpression()
|
||||||
{
|
{
|
||||||
@ -2088,6 +2208,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")"
|
* ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")"
|
||||||
|
*
|
||||||
|
* @return \Doctrine\ORM\Query\AST\ExistsExpression
|
||||||
*/
|
*/
|
||||||
public function ExistsExpression()
|
public function ExistsExpression()
|
||||||
{
|
{
|
||||||
@ -2109,6 +2231,8 @@ class Parser
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ComparisonOperator ::= "=" | "<" | "<=" | "<>" | ">" | ">=" | "!="
|
* ComparisonOperator ::= "=" | "<" | "<=" | "<>" | ">" | ">=" | "!="
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function ComparisonOperator()
|
public function ComparisonOperator()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user