Automattic\WooCommerce\Internal\Logging

OrderLogsDeletionProcessor::get_next_batch_to_process_hposprivateWC 1.0

Get the next batch of items to process, HPOS version.

Method of the class: OrderLogsDeletionProcessor{}

No Hooks.

Returns

Array.

Usage

// private - for code of main (parent) class only
$result = $this->get_next_batch_to_process_hpos( $size ): array;
$size(int) (required)
Maximum size of the batch to return.

OrderLogsDeletionProcessor::get_next_batch_to_process_hpos() code WC 10.8.1

private function get_next_batch_to_process_hpos( int $size ): array {
	global $wpdb;

	return $wpdb->get_results(
		$wpdb->prepare(
			"SELECT order_id, meta_value
                 FROM {$wpdb->prefix}wc_orders_meta
                 WHERE meta_key = %s
                 ORDER BY order_id
                 LIMIT %d",
			'_debug_log_source_pending_deletion',
			$size
		),
		ARRAY_A
	);
}