This method is similar to Query::batch except that in each iteration of the result,
only one row of data is returned. For example,
php
$query = (new Query)->from('user');
foreach ($query->each() as $row) {
}
public each ( integer $batchSize = 100, |
||
$batchSize | integer | the number of records to be fetched in each batch. |
$db | the database connection. If not set, the "db" application component will be used. | |
Résultat | the batch query result. It implements the [[\Iterator]] interface and can be traversed to retrieve the data in batches. |