Automattic\WooCommerce\Internal\DataStores\Orders

DataSynchronizer::get_next_batch_to_process()publicWC 1.0

Returns the batch with records that needs to be processed for a given size.

{} Это метод класса: DataSynchronizer{}

Хуков нет.

Возвращает

Массив. Batch of records.

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

$DataSynchronizer = new DataSynchronizer();
$DataSynchronizer->get_next_batch_to_process( $size ): array;
$size(int) (обязательный)
Size of the batch.

Код DataSynchronizer::get_next_batch_to_process() WC 6.9.4

public function get_next_batch_to_process( int $size ): array {
	if ( $this->custom_orders_table_is_authoritative() ) {
		$order_ids = $this->get_ids_of_orders_pending_sync( self::ID_TYPE_MISSING_IN_POSTS_TABLE, $size );
	} else {
		$order_ids = $this->get_ids_of_orders_pending_sync( self::ID_TYPE_MISSING_IN_ORDERS_TABLE, $size );
	}
	if ( count( $order_ids ) >= $size ) {
		return $order_ids;
	}

	$order_ids = $order_ids + $this->get_ids_of_orders_pending_sync( self::ID_TYPE_DIFFERENT_UPDATE_DATE, $size - count( $order_ids ) );
	return $order_ids;
}