Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9712506

Browse files
authored
Merge pull request #7729 from JoppeDC/patch-1
Update DATE_ADD and DATE_SUB docs
2 parents 2820438 + a98ebf7 commit 9712506

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

docs/en/reference/dql-doctrine-query-language.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ their inclusion in the SELECT clause.
103103
104104
In this case, the result will be an array of arrays. In the example
105105
above, each element of the result array would be an array of the
106-
scalar name and address values.
106+
scalar name and address values.
107107

108-
You can select scalars from any entity in the query.
108+
You can select scalars from any entity in the query.
109109

110110
**Mixed**
111111

@@ -691,8 +691,8 @@ clauses:
691691
- TRIM([LEADING \| TRAILING \| BOTH] ['trchar' FROM] str) - Trim
692692
the string by the given trim char, defaults to whitespaces.
693693
- UPPER(str) - Return the upper-case of the given string.
694-
- DATE_ADD(date, days, unit) - Add the number of days to a given date. (Supported units are DAY, MONTH)
695-
- DATE_SUB(date, days, unit) - Substract the number of days from a given date. (Supported units are DAY, MONTH)
694+
- DATE_ADD(date, value, unit) - Add the given time to a given date. (Supported units are SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR)
695+
- DATE_SUB(date, value, unit) - Subtract the given time from a given date. (Supported units are SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR)
696696
- DATE_DIFF(date1, date2) - Calculate the difference in days between date1-date2.
697697

698698
Arithmetic operators
@@ -1172,7 +1172,7 @@ why we are listing as many of the assumptions here for reference:
11721172
- If an object is already in memory from a previous query of any kind, then
11731173
then the previous object is used, even if the database may contain more
11741174
recent data. Data from the database is discarded. This even happens if the
1175-
previous object is still an unloaded proxy.
1175+
previous object is still an unloaded proxy.
11761176

11771177
This list might be incomplete.
11781178

@@ -1452,10 +1452,10 @@ Given that there are 10 users and corresponding addresses in the database the ex
14521452
SELECT * FROM address WHERE id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
14531453
14541454
.. note::
1455-
Changing the fetch mode during a query mostly makes sense for one-to-one and many-to-one relations. In that case,
1455+
Changing the fetch mode during a query mostly makes sense for one-to-one and many-to-one relations. In that case,
14561456
all the necessary IDs are available after the root entity (``user`` in the above example) has been loaded. So, one
14571457
query per association can be executed to fetch all the referred-to entities (``address``).
1458-
1458+
14591459
For one-to-many relations, changing the fetch mode to eager will cause to execute one query **for every root entity
14601460
loaded**. This gives no improvement over the ``lazy`` fetch mode which will also initialize the associations on
14611461
a one-by-one basis once they are accessed.

0 commit comments

Comments
 (0)