Automattic\WooCommerce\Admin\Features\Blueprint\Exporters

ExportWCSettingsTax::generateTaxRateStepsprivateWC 1.0

Generate SQL steps for exporting data.

Method of the class: ExportWCSettingsTax{}

No Hooks.

Returns

Array. Array of RunSql steps.

Usage

// private - for code of main (parent) class only
$result = $this->generateTaxRateSteps( $table ): array;
$table(string) (required)
Table identifier.

ExportWCSettingsTax::generateTaxRateSteps() code WC 9.9.5

private function generateTaxRateSteps( string $table ): array {
	global $wpdb;
	$table = $wpdb->prefix . $table;
	return array_map(
		fn( $record ) => new RunSql( Util::array_to_insert_sql( $record, $table, 'replace into' ) ),
		$wpdb->get_results( $wpdb->prepare( 'SELECT * FROM %i', $table ), ARRAY_A ),
	);
}