Skip to content

Commit 232283b

Browse files
committed
docs: Update documentation
1 parent 37d6527 commit 232283b

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎user_guide_src/source/changelogs/v4.8.0.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Method Signature Changes
6161
- **Config:** ``CodeIgniter\Config\Services::request()`` no longer accepts any parameter.
6262
- **Database:** The following methods have had their signatures updated to remove deprecated parameters:
6363
- ``CodeIgniter\Database\Forge::_createTable()`` no longer accepts the deprecated ``$ifNotExists`` parameter. The method signature is now ``_createTable(string $table, array $attributes)``.
64+
- ``CodeIgniter\Database\BaseBuilder::increment()`` and ``decrement()`` as well as driver-specific builders now accept a string or array for the first parameter, allowing multiple columns to be incremented/decremented in a single call. The method signatures are now ``increment(string|array $column, int $value = 1)`` and ``decrement(string|array $column, int $value = 1)``.
6465

6566
Property Scope Changes
6667
======================
@@ -208,6 +209,8 @@ Database
208209
Query Builder
209210
-------------
210211

212+
- Added support for incrementing/decrementing multiple columns in a single call to ``BaseBuilder::increment()`` and ``decrement()`` as well as driver-specific builders. See :ref:`query-builder-increment-decrement-multiple-columns` for details.
213+
211214
Forge
212215
-----
213216

‎user_guide_src/source/database/query_builder.rst‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,22 +2033,26 @@ Class Reference
20332033

20342034
.. php:method:: increment($column[, $value = 1])
20352035
2036-
:param string $column: The name of the column to increment
2037-
:param int $value: The amount to increment in the column
2036+
:param array|string $column: The name of the column(s) to increment. If multiple, then should be an array of column names with their values.
2037+
:param int $value: The amount to increment in the column (will be ignored if $column is an array)
20382038

20392039
Increments the value of a field by the specified amount. If the field
20402040
is not a numeric field, like a ``VARCHAR``, it will likely be replaced
20412041
with ``$value``.
20422042

2043+
.. note:: Prior to v4.8.0, only single columns could be incremented.
2044+
20432045
.. php:method:: decrement($column[, $value = 1])
20442046
2045-
:param string $column: The name of the column to decrement
2046-
:param int $value: The amount to decrement in the column
2047+
:param array|string $column: The name of the column(s) to decrement. If multiple, then should be an array of column names with their values.
2048+
:param int $value: The amount to decrement in the column (will be ignored if $column is an array)
20472049

20482050
Decrements the value of a field by the specified amount. If the field
20492051
is not a numeric field, like a ``VARCHAR``, it will likely be replaced
20502052
with ``$value``.
20512053

2054+
.. note:: Prior to v4.8.0, only single columns could be decremented.
2055+
20522056
.. php:method:: truncate()
20532057
20542058
:returns: ``true`` on success, ``false`` on failure, string on test mode

0 commit comments

Comments
 (0)