Skip to content

Commit 9d02d4e

Browse files
committed
Add docs
1 parent ffa4395 commit 9d02d4e

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

user_guide_src/source/changelogs/v4.8.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Others
5656
Model
5757
=====
5858

59+
- Added new ``chunkArray()`` method to ``CodeIgniter\Model`` for processing large datasets in smaller chunks. See :ref:`model-chunk-array` for usage.
60+
5961
Libraries
6062
=========
6163

user_guide_src/source/models/model.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,10 @@ This is best used during cronjobs, data exports, or other large tasks.
908908

909909
.. literalinclude:: model/049.php
910910

911+
On the other hand, if you want entire chunk to be passed to the Closure, you can use the chunkArray() method.
912+
913+
.. literalinclude:: model/064.php
914+
911915
.. _model-events-callbacks:
912916

913917
Working with Query Builder
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
$userModel->chunkArray(100, static function ($rows) {
4+
// do something.
5+
// $rows is an array of rows representing chunk of 100 items.
6+
});

0 commit comments

Comments
 (0)