QueryBatcher ​
- Type
- Class
- Namespace
- craft\db
- Inherits
- craft\db\QueryBatcher
- Implements
- craft\base\Batchable
- Since
- 4.4.0
QueryBatcher provides a craft\base\Batchable wrapper for a given yii\db\QueryInterface object.
Public Methods ​
| Method | Description |
|---|---|
| __construct() | Constructor |
| count() | |
| getSlice() | Returns a slice of the items |
__construct() ​
Constructor
WARNING
The query should have orderBy set on it, ideally to the table’s primary key column. That will ensure that the rows returned in result batches are consecutive.
Arguments ​
$query(yii\db\QueryInterface)$db(yii\db\Connection, null)
count() ​
getSlice() ​
Returns a slice of the items
Arguments ​
Returns ​
iterable