Skip to content

Commit 9d69905

Browse files
committed
docs: Update documentation
1 parent bff9dc8 commit 9d69905

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
@@ -60,6 +60,7 @@ Method Signature Changes
6060
- **Config:** ``CodeIgniter\Config\Services::request()`` no longer accepts any parameter.
6161
- **Database:** The following methods have had their signatures updated to remove deprecated parameters:
6262
- ``CodeIgniter\Database\Forge::_createTable()`` no longer accepts the deprecated ``$ifNotExists`` parameter. The method signature is now ``_createTable(string $table, array $attributes)``.
63+
- ``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)``.
6364

6465
Property Scope Changes
6566
======================
@@ -200,6 +201,8 @@ Database
200201
Query Builder
201202
-------------
202203

204+
- 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.
205+
203206
Forge
204207
-----
205208

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)