Automattic\WooCommerce\Admin\API\Reports
DataStore::sort_intervals()
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 (null).
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() DataStore::sort intervals code WC 8.7.0
protected function sort_intervals( &$data, $sort_by, $direction ) { $this->sort_array( $data->intervals, $sort_by, $direction ); }