WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Admin\API\Reports\Taxes

DataStore::add_from_sql_params() protected WC 1.0

Fills FROM clause of SQL request based on user supplied parameters.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->add_from_sql_params( $query_args, $order_status_filter );
$query_args(array) (required)
Query arguments supplied by the user.
$order_status_filter(string) (required)
Order status subquery.

Code of DataStore::add_from_sql_params() WC 6.1.0

protected function add_from_sql_params( $query_args, $order_status_filter ) {
	global $wpdb;
	$table_name = self::get_db_table_name();

	if ( $order_status_filter ) {
		$this->subquery->add_sql_clause( 'join', "JOIN {$wpdb->prefix}wc_order_stats ON {$table_name}.order_id = {$wpdb->prefix}wc_order_stats.order_id" );
	}

	if ( isset( $query_args['taxes'] ) && ! empty( $query_args['taxes'] ) ) {
		$this->add_sql_clause( 'join', "JOIN {$wpdb->prefix}woocommerce_tax_rates ON default_results.tax_rate_id = {$wpdb->prefix}woocommerce_tax_rates.tax_rate_id" );
	} else {
		$this->subquery->add_sql_clause( 'join', "JOIN {$wpdb->prefix}woocommerce_tax_rates ON {$table_name}.tax_rate_id = {$wpdb->prefix}woocommerce_tax_rates.tax_rate_id" );
	}
}