Automattic\WooCommerce\Admin\API\Reports

DataStore::sort_intervals()protectedWC 1.0

Sorts intervals according to user's request.

They are pre-sorted in SQL, but after adding gaps, they need to be sorted including the added ones.

Method of the class: DataStore{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->sort_intervals( $data, $sort_by, $direction );
$data(stdClass) (required) (passed by reference — &)
Data object, must contain an array under $data->intervals.
$sort_by(string) (required)
Ordering property.
$direction(string) (required)
DESC/ASC.

DataStore::sort_intervals() code WC 7.3.0

protected function sort_intervals( &$data, $sort_by, $direction ) {
	$this->sort_array( $data->intervals, $sort_by, $direction );
}