WordPress at Your Fingertips
function is not described

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

Segmenter::get_segments() protected WC 1.0

Return array of segments formatted for REST response.

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

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_segments( $type, $query_params, $table_name );
$type(string) (required)
Type of segments to return--'totals' or 'intervals'.
$query_params(array) (required)
SQL query parameter array.
$table_name(string) (required)
Name of main SQL table for the data store (used as basis for JOINS).

Code of Segmenter::get_segments() WC 6.1.0

protected function get_segments( $type, $query_params, $table_name ) {
	if ( ! isset( $this->query_args['segmentby'] ) || '' === $this->query_args['segmentby'] ) {
		return array();
	}

	$segmenting_where = '';
	$segmenting_from  = '';
	$segments         = array();

	if ( 'tax_rate_id' === $this->query_args['segmentby'] ) {
		$tax_rate_level_columns = $this->get_segment_selections_order_level( $table_name );
		$segmenting_select      = $this->prepare_selections( $tax_rate_level_columns );
		$this->report_columns   = $tax_rate_level_columns;
		$segmenting_groupby     = $table_name . '.tax_rate_id';

		$segments = $this->get_order_related_segments( $type, $segmenting_select, $segmenting_from, $segmenting_where, $segmenting_groupby, $table_name, $query_params );
	}

	return $segments;
}