Automattic\WooCommerce\Database\Migrations

MetaToCustomTableMigrator::process_update_batch()privateWC 1.0

Process batch for update into destination table.

Method of the class: MetaToCustomTableMigrator{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->process_update_batch( $batch, $ids_mapping ): void;
$batch(array) (required)
Data to insert, will be of the form as returned by data in fetch_data_for_migration_for_ids.
$ids_mapping(array) (required)
Maps rows to update data with their original IDs.

MetaToCustomTableMigrator::process_update_batch() code WC 8.7.0

private function process_update_batch( array $batch, array $ids_mapping ): void {
	if ( 0 === count( $batch ) ) {
		return;
	}

	$queries = $this->generate_update_sql_for_batch( $batch, $ids_mapping );
	// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Queries should already be prepared.
	$processed_rows_count = $this->db_query( $queries ) / 2;
	$this->maybe_add_insert_or_update_error( 'update', $processed_rows_count );
}