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 11.0.1

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