Automattic\WooCommerce\Database\Migrations

MetaToCustomTableMigrator::process_insert_batch()privateWC 1.0

Process batch for insertion into destination table.

{} It's a method of the class: MetaToCustomTableMigrator{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->process_insert_batch( $batch ): void;
$batch(array) (required)
Data to insert, will be of the form as returned by data in fetch_data_for_migration_for_ids.

Code of MetaToCustomTableMigrator::process_insert_batch() WC 7.1.0

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

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