Automattic\WooCommerce\Internal\DataStores\Orders

DataSynchronizer::process_batch()publicWC 1.0

Process data for current batch.

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

No Hooks.

Return

null. Nothing.

Usage

$DataSynchronizer = new DataSynchronizer();
$DataSynchronizer->process_batch( $batch ) : void;
$batch(array) (required)
Batch details.

Код DataSynchronizer::process_batch() WC 7.1.0

public function process_batch( array $batch ) : void {
	if ( $this->custom_orders_table_is_authoritative() ) {
		foreach ( $batch as $id ) {
			$order = wc_get_order( $id );
			if ( ! $order ) {
				$this->error_logger->error( "Order $id not found during batch process, skipping." );
				continue;
			}
			$data_store = $order->get_data_store();
			$data_store->backfill_post_record( $order );
		}
	} else {
		$this->posts_to_cot_migrator->migrate_orders( $batch );
	}
	if ( 0 === $this->get_total_pending_count() ) {
		$this->cleanup_synchronization_state();
	}
}