Automattic\WooCommerce\Internal\ProductFeed\Integrations\POSCatalog
AsyncGenerator::get_batch_size
Returns the number of products fetched per database batch.
Method of the class: AsyncGenerator{}
Hooks from the method
Returns
Int. The batch size (at least 1).
Usage
// private - for code of main (parent) class only $result = $this->get_batch_size(): int;
AsyncGenerator::get_batch_size() AsyncGenerator::get batch size code WC 11.0.0
private function get_batch_size(): int {
/**
* Filters the number of products fetched per database query during feed generation.
*
* This is the granularity within a chunk; see `woocommerce_product_feed_chunk_size` for how many
* products each Action Scheduler action processes.
*
* @param int $batch_size The number of products per database batch.
*
* @since 11.0.0
*/
$batch_size = (int) apply_filters( 'woocommerce_product_feed_batch_size', self::BATCH_SIZE );
return (int) max( 1, $batch_size );
}