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.
Метод класса: OrderCouponDataMigrator{}
Хуков нет.
Возвращает
Массив. Batch of items to process, containing $size or less items.
Использование
$OrderCouponDataMigrator = new OrderCouponDataMigrator(); $OrderCouponDataMigrator->get_next_batch_to_process( $size ): array;
- $size(int) (обязательный)
- Maximum size of the batch to be returned.
Код OrderCouponDataMigrator::get_next_batch_to_process() OrderCouponDataMigrator::get next batch to process WC 10.7.0
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 );
}