Automattic\WooCommerce\Internal
OrderCouponDataMigrator::get_next_batch_to_process
Returns the next batch of items that need to be processed. A batch in this context is a list of 'meta_id' values from the wp_woocommerce_order_itemmeta table.
Method of the class: OrderCouponDataMigrator{}
No Hooks.
Returns
Array. Batch of items to process, containing $size or less items.
Usage
$OrderCouponDataMigrator = new OrderCouponDataMigrator(); $OrderCouponDataMigrator->get_next_batch_to_process( $size ): array;
- $size(int) (required)
- Maximum size of the batch to be returned.
OrderCouponDataMigrator::get_next_batch_to_process() OrderCouponDataMigrator::get next batch to process code WC 10.3.3
public function get_next_batch_to_process( int $size ): array {
global $wpdb;
$meta_ids = $wpdb->get_col(
$wpdb->prepare(
"SELECT meta_id FROM {$wpdb->prefix}woocommerce_order_itemmeta WHERE meta_key=%s ORDER BY meta_id ASC LIMIT %d",
'coupon_data',
$size
)
);
return array_map( 'absint', $meta_ids );
}