diff --git a/manual/new/docs/en/dql-doctrine-query-language/conditional-expressions.txt b/manual/new/docs/en/dql-doctrine-query-language/conditional-expressions.txt index 543e6e5c0..cf3f79cfd 100644 --- a/manual/new/docs/en/dql-doctrine-query-language/conditional-expressions.txt +++ b/manual/new/docs/en/dql-doctrine-query-language/conditional-expressions.txt @@ -4,7 +4,7 @@ A string literal is enclosed in single quotes; for example: 'literal'. A string literal that includes a single quote is represented by two single quotes; for example: 'literal''s'. - + FROM User WHERE User.name = 'Vincent' @@ -12,7 +12,7 @@ FROM User WHERE User.name = 'Vincent' Integer literals support the use of PHP integer literal syntax. - + FROM User WHERE User.id = 4 @@ -20,7 +20,7 @@ FROM User WHERE User.id = 4 Float literals support the use of PHP float literal syntax. - + FROM Account WHERE Account.amount = 432.123 @@ -28,7 +28,7 @@ FROM Account WHERE Account.amount = 432.123 The boolean literals are true and false. - + FROM User WHERE User.admin = true FROM Session WHERE Session.is_authed = false @@ -38,7 +38,7 @@ FROM Session WHERE Session.is_authed = false The enumerated values work in the same way as string literals. - + FROM User WHERE User.type = 'admin' @@ -96,7 +96,7 @@ An IN conditional expression returns true if the //operand// is found from resul When //value list// is being used there must be at least one element in that list. - + FROM C1 WHERE C1.col1 IN (FROM C2(col1)); FROM User WHERE User.id IN (1,3,4,5) @@ -104,7 +104,7 @@ FROM User WHERE User.id IN (1,3,4,5) The keyword IN is an alias for = ANY. Thus, these two statements are equal: - + FROM C1 WHERE C1.col1 = ANY (FROM C2(col1)); FROM C1 WHERE C1.col1 IN (FROM C2(col1)); @@ -157,7 +157,7 @@ The NOT EXISTS operator returns TRUE if the subquery returns 0 rows and FALSE ot Finding all articles which have readers: - + FROM Article a WHERE EXISTS (SELECT r.id FROM ReaderLog r WHERE r.article_id = a.id) @@ -165,7 +165,7 @@ FROM Article a Finding all articles which don't have readers: - + FROM Article a WHERE NOT EXISTS (SELECT r.id FROM ReaderLog r WHERE r.article_id = a.id) @@ -184,19 +184,19 @@ operand comparison_operator ALL (subquery) An ALL conditional expression returns true if the comparison operation is true for all values in the result of the subquery or the result of the subquery is empty. An ALL conditional expression is false if the result of the comparison is false for at least one row, and is unknown if neither true nor false. - + FROM C WHERE C.col1 < ALL (FROM C2(col1)) An ANY conditional expression returns true if the comparison operation is true for some value in the result of the subquery. An ANY conditional expression is false if the result of the subquery is empty or if the comparison operation is false for every value in the result of the subquery, and is unknown if neither true nor false. - + FROM C WHERE C.col1 > ANY (FROM C2(col1)) The keyword SOME is an alias for ANY. - + FROM C WHERE C.col1 > SOME (FROM C2(col1)) @@ -204,7 +204,7 @@ The comparison operators that can be used with ALL or ANY conditional expression NOT IN is an alias for <> ALL. Thus, these two statements are equal: - + FROM C WHERE C.col1 <> ALL (FROM C2(col1)); FROM C WHERE C.col1 NOT IN (FROM C2(col1)); diff --git a/manual/new/docs/en/dql-doctrine-query-language/delete-queries.txt b/manual/new/docs/en/dql-doctrine-query-language/delete-queries.txt index 29a4dac34..af74d9cab 100644 --- a/manual/new/docs/en/dql-doctrine-query-language/delete-queries.txt +++ b/manual/new/docs/en/dql-doctrine-query-language/delete-queries.txt @@ -1,4 +1,4 @@ - + DELETE FROM [WHERE ] [ORDER BY ...] diff --git a/manual/new/docs/en/dql-doctrine-query-language/from-clause.txt b/manual/new/docs/en/dql-doctrine-query-language/from-clause.txt index 5492d7033..eb039e54e 100644 --- a/manual/new/docs/en/dql-doctrine-query-language/from-clause.txt +++ b/manual/new/docs/en/dql-doctrine-query-language/from-clause.txt @@ -1,13 +1,13 @@ Syntax: - + FROM [[LEFT | INNER] JOIN ] ... The {{FROM}} clause indicates the component or components from which to retrieve records. If you name more than one component, you are performing a join. For each table specified, you can optionally specify an alias. Consider the following DQL query: - + FROM User u diff --git a/manual/new/docs/en/dql-doctrine-query-language/group-by-having-clauses.txt b/manual/new/docs/en/dql-doctrine-query-language/group-by-having-clauses.txt index 2415565fc..ac98c8c87 100644 --- a/manual/new/docs/en/dql-doctrine-query-language/group-by-having-clauses.txt +++ b/manual/new/docs/en/dql-doctrine-query-language/group-by-having-clauses.txt @@ -3,25 +3,25 @@ Selecting alphabetically first user by name. - + SELECT MIN(u.name) FROM User u Selecting the sum of all Account amounts. - + SELECT SUM(a.amount) FROM Account a * Using an aggregate function in a statement containing no GROUP BY clause, results in grouping on all rows. In the example above we fetch all users and the number of phonenumbers they have. - + SELECT u.*, COUNT(p.id) FROM User u, u.Phonenumber p GROUP BY u.id * The HAVING clause can be used for narrowing the results using aggregate values. In the following example we fetch all users which have atleast 2 phonenumbers - + SELECT u.* FROM User u, u.Phonenumber p HAVING COUNT(p.id) >= 2 diff --git a/manual/new/docs/en/dql-doctrine-query-language/join-syntax.txt b/manual/new/docs/en/dql-doctrine-query-language/join-syntax.txt index 7da7cf403..a44f8dbfa 100644 --- a/manual/new/docs/en/dql-doctrine-query-language/join-syntax.txt +++ b/manual/new/docs/en/dql-doctrine-query-language/join-syntax.txt @@ -11,7 +11,7 @@ DQL supports two kinds of joins INNER JOINs and LEFT JOINs. For each joined comp * The default join type is {{LEFT JOIN}}. This join can be indicated by the use of either {{LEFT JOIN}} clause or simply '{{,}}', hence the following queries are equal: - + SELECT u.*, p.* FROM User u LEFT JOIN u.Phonenumber SELECT u.*, p.* FROM User u, u.Phonenumber p @@ -21,32 +21,32 @@ The recommended form is the first one. * {{INNER JOIN}} produces an intersection between two specified components (that is, each and every record in the first component is joined to each and every record in the second component). So basically {{INNER JOIN}} can be used when you want to efficiently fetch for example all users which have one or more phonenumbers. - + SELECT u.*, p.* FROM User u INNER JOIN u.Phonenumber p By default DQL auto-adds the primary key join condition, so for DQL query: - + SELECT u.id, p.id FROM User u LEFT JOIN u.Phonenumber Would have a SQL equivalent: - + SELECT u.id AS u__id, p.id AS p__id FROM User u LEFT JOIN Phonenumber p ON u.id = p.user_id +++ ON keyword If you want to override this behaviour and add your own custom join condition you can do it with the {{ON}} keyword. Consider the following DQL query: - + SELECT u.id, p.id FROM User u LEFT JOIN u.Phonenumber ON u.id = 2 This query would be converted into SQL: - + SELECT u.id AS u__id, p.id AS p__id FROM User u LEFT JOIN Phonenumber p ON u.id = 2 @@ -54,12 +54,12 @@ SELECT u.id AS u__id, p.id AS p__id FROM User u LEFT JOIN Phonenumber p ON u.id Most of the time you don't need to override the primary join condition, rather you may want to add some custom conditions. This can be achieved with the {{WITH}} keyword. DQL: - + SELECT u.id, p.id FROM User u LEFT JOIN u.Phonenumber WITH u.id = 2 SQL: - + SELECT u.id AS u__id, p.id AS p__id FROM User u LEFT JOIN Phonenumber p ON u.id = p.user_id AND u.id = 2 diff --git a/manual/new/docs/en/dql-doctrine-query-language/limit-and-offset-clauses.txt b/manual/new/docs/en/dql-doctrine-query-language/limit-and-offset-clauses.txt index ae49a29ab..15eac34e0 100644 --- a/manual/new/docs/en/dql-doctrine-query-language/limit-and-offset-clauses.txt +++ b/manual/new/docs/en/dql-doctrine-query-language/limit-and-offset-clauses.txt @@ -47,13 +47,13 @@ DQL overcomes this problem with subqueries and with complex but efficient subque DQL QUERY: - + SELECT u.id, u.name, p.* FROM User u LEFT JOIN u.Phonenumber p LIMIT 20 SQL QUERY: - + SELECT e.id AS e__id, e.name AS e__name, @@ -72,13 +72,13 @@ In the next example we are going to fetch first 20 users and all their phonenumb DQL QUERY: - + SELECT u.id, u.name, p.* FROM User u LEFT JOIN u.Phonenumber p LIMIT 20 SQL QUERY: - + SELECT e.id AS e__id, e.name AS e__name, diff --git a/manual/new/docs/en/dql-doctrine-query-language/order-by-clause.txt b/manual/new/docs/en/dql-doctrine-query-language/order-by-clause.txt index 7425f717a..118e3bdcd 100644 --- a/manual/new/docs/en/dql-doctrine-query-language/order-by-clause.txt +++ b/manual/new/docs/en/dql-doctrine-query-language/order-by-clause.txt @@ -11,7 +11,7 @@ Syntax: Examples: - + FROM User u LEFT JOIN u.Phonenumber p ORDER BY u.name, p.phonenumber @@ -21,7 +21,7 @@ FROM User u, u.Email e In order to sort in reverse order you can add the DESC (descending) keyword to the name of the column in the ORDER BY clause that you are sorting by. The default is ascending order; this can be specified explicitly using the ASC keyword. - + FROM User u LEFT JOIN u.Email e ORDER BY e.address DESC, u.id ASC; diff --git a/manual/new/docs/en/dql-doctrine-query-language/select-queries.txt b/manual/new/docs/en/dql-doctrine-query-language/select-queries.txt index d5cc92eae..87263505a 100644 --- a/manual/new/docs/en/dql-doctrine-query-language/select-queries.txt +++ b/manual/new/docs/en/dql-doctrine-query-language/select-queries.txt @@ -1,6 +1,6 @@ {{SELECT}} statement syntax: - + SELECT [ALL | DISTINCT] , ... @@ -18,19 +18,19 @@ The {{SELECT}} statement is used for the retrieval of data from one or more comp * Each {{select_expr}} indicates a column or an aggregate function value that you want to retrieve. There must be at least one {{select_expr}} in every {{SELECT}} statement. - + SELECT a.name, a.amount FROM Account a * An asterisk can be used for selecting all columns from given component. Even when using an asterisk the executed sql queries never actually use it (Doctrine converts asterisk to appropriate column names, hence leading to better performance on some databases). - + SELECT a.* FROM Account a * {{FROM}} clause {{components}} indicates the component or components from which to retrieve records. - + SELECT a.* FROM Account a SELECT u.*, p.*, g.* FROM User u LEFT JOIN u.Phonenumber p LEFT JOIN u.Group g @@ -38,26 +38,26 @@ SELECT u.*, p.*, g.* FROM User u LEFT JOIN u.Phonenumber p LEFT JOIN u.Group g * The {{WHERE}} clause, if given, indicates the condition or conditions that the records must satisfy to be selected. {{where_condition}} is an expression that evaluates to true for each row to be selected. The statement selects all rows if there is no {{WHERE}} clause. - + SELECT a.* FROM Account a WHERE a.amount > 2000 * In the {{WHERE}} clause, you can use any of the functions and operators that DQL supports, except for aggregate (summary) functions * The {{HAVING}} clause can be used for narrowing the results with aggregate functions - + SELECT u.* FROM User u LEFT JOIN u.Phonenumber p HAVING COUNT(p.id) > 3 * The {{ORDER BY}} clause can be used for sorting the results - + SELECT u.* FROM User u ORDER BY u.name * The {{LIMIT}} and {{OFFSET}} clauses can be used for efficiently limiting the number of records to a given {{row_count}} - + SELECT u.* FROM User u LIMIT 20 diff --git a/manual/new/docs/en/dql-doctrine-query-language/update-queries.txt b/manual/new/docs/en/dql-doctrine-query-language/update-queries.txt index b967517a8..29cbfa165 100644 --- a/manual/new/docs/en/dql-doctrine-query-language/update-queries.txt +++ b/manual/new/docs/en/dql-doctrine-query-language/update-queries.txt @@ -1,6 +1,6 @@ {{UPDATE}} statement syntax: - + UPDATE //component_name// SET //col_name1//=//expr1// [, //col_name2//=//expr2// ...] [WHERE //where_condition//] diff --git a/manual/new/docs/en/dql-doctrine-query-language/where-clause.txt b/manual/new/docs/en/dql-doctrine-query-language/where-clause.txt index 974264896..9ffab2761 100644 --- a/manual/new/docs/en/dql-doctrine-query-language/where-clause.txt +++ b/manual/new/docs/en/dql-doctrine-query-language/where-clause.txt @@ -1,6 +1,6 @@ Syntax: - + WHERE