BatchProcessorInterface::get_next_batch_to_process()publicWC 1.0

Returns the next batch of items that need to be processed.

A batch item can be anything needed to identify the actual processing to be done, but whenever possible items should be numbers (e.g. database record ids) or at least strings, to ease troubleshooting and logging in case of problems.

The size of the batch returned can be less than $size if there aren't that many items pending processing (and it can be zero if there isn't anything to process), but the size should always be consistent with what 'get_total_pending_count' returns (i.e. the size of the returned batch shouldn't be larger than the pending items count).

Method of the class: BatchProcessorInterface{}

No Hooks.


Array. Batch of items to process, containing $size or less items.


$BatchProcessorInterface = new BatchProcessorInterface();
$BatchProcessorInterface->get_next_batch_to_process( $size ) : array;
$size(int) (required)
Maximum size of the batch to be returned.

BatchProcessorInterface::get_next_batch_to_process() code WC 8.9.0

public function get_next_batch_to_process( int $size ) : array;