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 <sarahmccarthy123@yahoo.com>
Co-authored-by: Lina Wolf <48202465+linawolf@users.noreply.github.com>
(cherry picked from commit 1f12b90)
**Always** use this when dealing with user input in expressions to protect
559
565
the statement from SQL injections.
560
566
561
-
* :php:`->where()` should be called only once per query and resets all
562
-
previously set :php:`->where()`, :php:`->andWhere()` and :php:`->orWhere()`
563
-
expressions. A :php:`->where()` call after a previous :php:`->where()`,
564
-
:php:`->andWhere()` or :php:`->orWhere()` usually indicates a bug or a
565
-
rather weird code flow. Doing so is discouraged.
567
+
* :php:`->where()` replaces all previously set :php:`->where()`,
568
+
:php:`->andWhere()` and :php:`->orWhere()` expressions. It should therefore
569
+
be called only once and at the beginning of a query to prevent unwanted behavior.
566
570
567
571
* When creating complex :sql:`WHERE` restrictions, :php:`->getSQL()` and
568
572
:php:`->getParameters()` are helpful debugging tools to verify parenthesis
@@ -872,12 +876,12 @@ queries.
872
876
be a performance improvement.
873
877
874
878
.. note::
875
-
While technically possible, it is not recommended to send direct SQL queries
876
-
as strings to the `union()` and `addUnion()` methods. We recommend to use a
879
+
Although it is technically possible, it is not recommended to send direct SQL queries
880
+
as strings to the `union()` and `addUnion()` methods. We recommend using a
877
881
query builder.
878
882
879
883
If you decide to do so you **must** take care of quoting, escaping, and
880
-
valid SQL Syntax for the database system in question. The `Default Restrictions <https://docs.typo3.org/permalink/t3coreapi:database-query-builder-select-restrictions>`_
884
+
valid SQL Syntax for the database system in question. The `Default Restrictions <https://docs.typo3.org/permalink/t3coreapi:database-query-builder-default-restrictions>`_
881
885
are **not applied** on that part.
882
886
883
887
Named placeholders, such as created by :php:`QueryBuilder::createNamedParameter()`
@@ -924,7 +928,7 @@ Line 41
924
928
Line 50
925
929
Named parameters must also be called on the outer most union query builder.
926
930
927
-
The `Default Restrictions <https://docs.typo3.org/permalink/t3coreapi:database-query-builder-select-restrictions>`_
931
+
The `Default Restrictions <https://docs.typo3.org/permalink/t3coreapi:database-query-builder-default-restrictions>`_
0 commit comments