@@ -1107,18 +1107,20 @@ $builder->updateBatch()
11071107.. note :: Since v4.3.0, the second parameter ``$index`` of ``updateBatch()`` has
11081108 changed to ``$constraints ``. It now accepts types array, string, or ``RawSql ``.
11091109
1110+ Update from Data
1111+ ^^^^^^^^^^^^^^^^
1112+
11101113Generates an update string based on the data you supply, and runs the query.
11111114You can either pass an **array ** or an **object ** to the method.
11121115Here is an example using an array:
11131116
11141117.. literalinclude :: query_builder/092.php
11151118
1116- .. note :: Since v4.3.0 , the generated SQL structure has been Improved .
1119+ The first parameter is an associative array of values , the second parameter is the where keys .
11171120
1118- The first parameter is an associative array of values , the second parameter is the where key .
1121+ .. note :: Since v4.3.0 , the generated SQL structure has been Improved .
11191122
1120- Since v4.3.0, you can also use the ``setQueryAsData() ``, ``onConstraint() ``, and
1121- ``updateFields() `` methods:
1123+ Since v4.3.0, you can also use the ``onConstraint() `` and ``updateFields() `` methods:
11221124
11231125.. literalinclude :: query_builder/120.php
11241126
@@ -1130,12 +1132,12 @@ Since v4.3.0, you can also use the ``setQueryAsData()``, ``onConstraint()``, and
11301132 due to the very nature of how it works. Instead, ``updateBatch() ``
11311133 returns the number of rows affected.
11321134
1133- You can also update from a query:
1135+ Update from a Query
1136+ ^^^^^^^^^^^^^^^^^^^
11341137
1135- .. literalinclude :: query_builder/116.php
1138+ Since v4.3.0, you can also update from a query with the `` setQueryAsData() `` method:
11361139
1137- .. note :: The ``setQueryAsData()``, ``onConstraint()``, and ``updateFields()``
1138- methods can be used since v4.3.0.
1140+ .. literalinclude :: query_builder/116.php
11391141
11401142.. note :: It is required to alias the columns of the select query to match those of the target table.
11411143
0 commit comments