Skip to content

Commit d419f71

Browse files
authored
Merge pull request #6597 from kenjis/follow-up-6536
docs: update QueryBuilder *Batch methods
2 parents c44f36b + fd65d4b commit d419f71

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

user_guide_src/source/database/query_builder.rst

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,18 +1612,20 @@ Class Reference
16121612

16131613
.. php:method:: updateBatch([$set = null[, $constraints = null[, $batchSize = 100]]])
16141614
1615-
:param array $set: Field name, or an associative array of field/value pairs
1616-
:param mixed $constraints: The field or fields used as keys to update on.
1615+
:param array|object|null $set: Field name, or an associative array of field/value pairs
1616+
:param array|RawSql|string|null $constraints: The field or fields used as keys to update on.
16171617
:param int $batchSize: Count of conditions to group in a single query
16181618
:returns: Number of rows updated or ``false`` on failure
16191619
:rtype: int|false
16201620

1621+
.. note:: Since v4.3.0, the types of the parameters ``$set`` and ``$constraints`` have changed.
1622+
16211623
Compiles and executes batch ``UPDATE`` statements.
1622-
The ``$constraints`` parameter takes a comma delimited string of columns, an array, an associative array, or RawSql.
1624+
The ``$constraints`` parameter takes a comma delimited string of columns, an array, an associative array, or ``RawSql``.
16231625

16241626
.. note:: When more than ``$batchSize`` field/value pairs are provided,
1625-
multiple queries will be executed, each handling up to ``$batchSize``
1626-
field/value pairs. If we set ``$batchSize`` to 0, then all field/value
1627+
multiple queries will be executed, each handling up to ``$batchSize``
1628+
field/value pairs. If we set ``$batchSize`` to 0, then all field/value
16271629
pairs will be executed in one query.
16281630

16291631
.. php:method:: updateFields($set, [$addToDefault = false, [$ignore = null]])
@@ -1634,6 +1636,8 @@ Class Reference
16341636
:returns: ``BaseBuilder`` instance (method chaining)
16351637
:rtype: ``BaseBuilder``
16361638

1639+
.. versionadded:: 4.3.0
1640+
16371641
Used with ``updateBatch()`` and ``upsertBatch()`` methods. This defines the fields which will be updated.
16381642

16391643
.. php:method:: onConstraint($set)
@@ -1642,6 +1646,8 @@ Class Reference
16421646
:returns: ``BaseBuilder`` instance (method chaining)
16431647
:rtype: ``BaseBuilder``
16441648

1649+
.. versionadded:: 4.3.0
1650+
16451651
Used with ``updateBatch()`` and ``upsertBatch()`` methods. This takes a comma delimited string of columns, and array, associative array, or RawSql.
16461652

16471653
.. php:method:: setData($set, [$escape = null, [$alias = '']])
@@ -1652,6 +1658,8 @@ Class Reference
16521658
:returns: ``BaseBuilder`` instance (method chaining)
16531659
:rtype: ``BaseBuilder``
16541660

1661+
.. versionadded:: 4.3.0
1662+
16551663
Used for ``*Batch()`` methods to set data for insert, update, upsert.
16561664

16571665
.. php:method:: setAlias($alias)
@@ -1660,6 +1668,8 @@ Class Reference
16601668
:returns: ``BaseBuilder`` instance (method chaining)
16611669
:rtype: ``BaseBuilder``
16621670

1671+
.. versionadded:: 4.3.0
1672+
16631673
This allows setting an alias for the psuedo table generated with ``setData()``.
16641674

16651675
.. php:method:: setUpdateBatch($key[, $value = ''[, $escape = null]])

0 commit comments

Comments
 (0)