WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats

Segmenter::get_order_related_totals_segments() protected WC 1.0

Calculate segments for totals query where the segmenting property is bound to order (e.g. coupon or customer type).

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

No Hooks.

Return

Array. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_order_related_totals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $totals_query );
$segmenting_select(string) (required)
SELECT part of segmenting SQL query.
$segmenting_from(string) (required)
FROM part of segmenting SQL query.
$segmenting_where(string) (required)
WHERE part of segmenting SQL query.
$segmenting_groupby(string) (required)
GROUP BY part of segmenting SQL query.
$table_name(string) (required)
Name of SQL table which is the stats table for orders.
$totals_query(array) (required)
Array of SQL clauses for intervals query.

Code of Segmenter::get_order_related_totals_segments() WC 5.3.0

<?php
protected function get_order_related_totals_segments( $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $totals_query ) {
	global $wpdb;

	$totals_segments = $wpdb->get_results(
		"SELECT
					$segmenting_groupby
					$segmenting_select
				FROM
					$table_name
					$segmenting_from
					{$totals_query['from_clause']}
				WHERE
					1=1
					{$totals_query['where_time_clause']}
					{$totals_query['where_clause']}
					$segmenting_where
				GROUP BY
					$segmenting_groupby",
		ARRAY_A
	); // WPCS: cache ok, DB call ok, unprepared SQL ok.

	// Reformat result.
	$totals_segments = $this->reformat_totals_segments( $totals_segments, $segmenting_groupby );
	return $totals_segments;
}