You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add notes about RestrictionBuilder
The RestrictionBuilder should be mentioned on the top. It is used for every SQL query by default.
* restrictions by default only with SELECT queries
Clarified the note about RestrictionBuilder's default restrictions in select queries.
* better explanation for `->where()`
See
https://symfonycasts.com/screencast/doctrine-queries/and-where-or-where
andWhere() vs where()
What's wrong with ->where()? Well, if you added a WHERE clause to your QueryBuilder earlier, calling ->where() would remove that and replace it with the new stuff... which probably isn't what you want. ->andWhere() always adds to the query.
* make the SELECT default restrictions findable
I have found another NOTE which explains the default restrictions. I have merged 2 NOTE boxes.
* [DOCS] Language checks
Releases: main
* are defined
* Apply suggestion from @linawolf
* Add default restrictions link name
I add an additional link name, because it is a default restriction. This topic has not been called select restriction in the past, I guess.
---------
Co-authored-by: Sarah McCarthy <[email protected]>
Co-authored-by: Lina Wolf <[email protected]>
**Always** use this when dealing with user input in expressions to protect
565
571
the statement from SQL injections.
566
572
567
-
* :php:`->where()` should be called only once per query and resets all
568
-
previously set :php:`->where()`, :php:`->andWhere()` and :php:`->orWhere()`
569
-
expressions. A :php:`->where()` call after a previous :php:`->where()`,
570
-
:php:`->andWhere()` or :php:`->orWhere()` usually indicates a bug or a
571
-
rather weird code flow. Doing so is discouraged.
573
+
* :php:`->where()` replaces all previously set :php:`->where()`,
574
+
:php:`->andWhere()` and :php:`->orWhere()` expressions. It should therefore
575
+
be called only once and at the beginning of a query to prevent unwanted behavior.
572
576
573
577
* When creating complex :sql:`WHERE` restrictions, :php:`->getSQL()` and
574
578
:php:`->getParameters()` are helpful debugging tools to verify parenthesis
@@ -880,12 +884,12 @@ queries.
880
884
be a performance improvement.
881
885
882
886
.. note::
883
-
While technically possible, it is not recommended to send direct SQL queries
884
-
as strings to the `union()` and `addUnion()` methods. We recommend to use a
887
+
Although it is technically possible, it is not recommended to send direct SQL queries
888
+
as strings to the `union()` and `addUnion()` methods. We recommend using a
885
889
query builder.
886
890
887
891
If you decide to do so you **must** take care of quoting, escaping, and
888
-
valid SQL Syntax for the database system in question. The `Default Restrictions <https://docs.typo3.org/permalink/t3coreapi:database-query-builder-select-restrictions>`_
892
+
valid SQL Syntax for the database system in question. The `Default Restrictions <https://docs.typo3.org/permalink/t3coreapi:database-query-builder-default-restrictions>`_
889
893
are **not applied** on that part.
890
894
891
895
Named placeholders, such as created by :php:`QueryBuilder::createNamedParameter()`
@@ -932,7 +936,7 @@ Line 41
932
936
Line 50
933
937
Named parameters must also be called on the outer most union query builder.
934
938
935
-
The `Default Restrictions <https://docs.typo3.org/permalink/t3coreapi:database-query-builder-select-restrictions>`_
939
+
The `Default Restrictions <https://docs.typo3.org/permalink/t3coreapi:database-query-builder-default-restrictions>`_
0 commit comments