ProcessesQuery

Console Command Trait that provides the "processQuery($query, $callback, $chunkSize, $limit)" helper method to cleanly handle processing a large number of records in the console.

 trait Winter\Storm\Console\Traits\ProcessesQuery

Methods

public processQuery (Winter\Storm\Database\Builder $query, callable $callback, integer $chunkSize = 100, $limit = null) : void

Processes the provided query by rendering a progress bar, chunking the query by the provided chunkSize, running the callback on each record and limiting number of records processed to the provided limit

Parameters
Property Description
$query
Winter\Storm\Database\Builder
$callback
callable
$chunkSize
integer
$limit
mixed
Returns
void
Copyright © 2024 Winter CMS