Permalink
Browse files

Added support to CaseExpression.

1 parent 60ed776 commit 189c729f15d2fafecf92662cad9553c2ec3dccd7 @guilhermeblanco guilhermeblanco committed Aug 8, 2011
Showing with 18 additions and 3 deletions.
  1. +18 −3 en/reference/dql-doctrine-query-language.rst
@@ -1469,6 +1469,7 @@ Conditional Expressions
InExpression | NullComparisonExpression | ExistsExpression |
EmptyCollectionComparisonExpression | CollectionMemberExpression
+
Collection Expressions
~~~~~~~~~~~~~~~~~~~~~~
@@ -1505,17 +1506,17 @@ Arithmetic Expressions
ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary
ArithmeticPrimary ::= SingleValuedPathExpression | Literal | "(" SimpleArithmeticExpression ")"
| FunctionsReturningNumerics | AggregateExpression | FunctionsReturningStrings
- | FunctionsReturningDatetime | IdentificationVariable | InputParameter
+ | FunctionsReturningDatetime | IdentificationVariable | InputParameter | CaseExpression
Scalar and Type Expressions
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: php
ScalarExpression ::= SimpleArithmeticExpression | StringPrimary | DateTimePrimary | StateFieldPathExpression
- BooleanPrimary | EntityTypeExpression
+ BooleanPrimary | EntityTypeExpression | CaseExpression
StringExpression ::= StringPrimary | "(" Subselect ")"
- StringPrimary ::= StateFieldPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression
+ StringPrimary ::= StateFieldPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression | CaseExpression
BooleanExpression ::= BooleanPrimary | "(" Subselect ")"
BooleanPrimary ::= StateFieldPathExpression | boolean | InputParameter
EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression
@@ -1535,6 +1536,20 @@ Aggregate Expressions
AggregateExpression ::= ("AVG" | "MAX" | "MIN" | "SUM") "(" ["DISTINCT"] StateFieldPathExpression ")" |
"COUNT" "(" ["DISTINCT"] (IdentificationVariable | SingleValuedPathExpression) ")"
+Case Expressions
+~~~~~~~~~~~~~~~~
+
+.. code-block:: php
+
+ CaseExpression ::= GeneralCaseExpression | SimpleCaseExpression | CoalesceExpression | NullifExpression
+ GeneralCaseExpression ::= "CASE" WhenClause {WhenClause}* "ELSE" ScalarExpression "END"
+ WhenClause ::= "WHEN" ConditionalExpression "THEN" ScalarExpression
+ SimpleCaseExpression ::= "CASE" CaseOperand SimpleWhenClause {SimpleWhenClause}* "ELSE" ScalarExpression "END"
+ CaseOperand ::= StateFieldPathExpression | TypeDiscriminator
+ SimpleWhenClause ::= "WHEN" ScalarExpression "THEN" ScalarExpression
+ CoalesceExpression ::= "COALESCE" "(" ScalarExpression {"," ScalarExpression}* ")"
+ NullifExpression ::= "NULLIF" "(" ScalarExpression "," ScalarExpression ")"
+
Other Expressions
~~~~~~~~~~~~~~~~~

0 comments on commit 189c729

Please sign in to comment.