Automattic\WooCommerce\Internal\Logging

OrderLogsDeletionProcessor::get_next_batch_to_process_cpt │ private │ WC 1.0

Get the next batch of items to process, CPT datastore version.

Метод класса: OrderLogsDeletionProcessor{}

Хуков нет.

Возвращает

array.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_next_batch_to_process_cpt( $size ): array;
$size(int) (обязательный)
Maximum size of the batch to return.

Код OrderLogsDeletionProcessor::get_next_batch_to_process_cpt() WC 11.2.2

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

	return $wpdb->get_results(
		$wpdb->prepare(
			"SELECT p.ID as order_id, pm.meta_value
                 FROM {$wpdb->postmeta} pm
                 INNER JOIN {$wpdb->posts} p ON pm.post_id = p.ID
                 WHERE pm.meta_key = %s
                 AND p.post_type = 'shop_order'
                 ORDER BY p.ID
                 LIMIT %d",
			'_debug_log_source_pending_deletion',
			$size
		),
		ARRAY_A
	);
}