Skip to content

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.

View source

Public Methods ​

MethodDescription
__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.

View source

Arguments ​

count() ​

View source

getSlice() ​

Returns a slice of the items

View source

Arguments ​

Returns ​

iterable