WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports

DataStore::add_order_by_clause() protected WC 1.0

Add order by SQL clause if included in query.

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

No Hooks.

Return

String. Order by clause.

Usage

// protected - for code of main (parent) or child class
$result = $this->add_order_by_clause( $query_args, $sql_query );
$query_args(array) (required) (passed by reference — &)
Parameters supplied by the user.
$sql_query(SqlQuery) (required) (passed by reference — &)
Query object.

Code of DataStore::add_order_by_clause() WC 5.3.0

<?php
protected function add_order_by_clause( $query_args, &$sql_query ) {
	$order_by_clause = '';

	$sql_query->clear_sql_clause( array( 'order_by' ) );
	if ( isset( $query_args['orderby'] ) ) {
		$order_by_clause = $this->normalize_order_by( $query_args['orderby'] );
		$sql_query->add_sql_clause( 'order_by', $order_by_clause );
	}

	// Return ORDER BY clause to allow adding the sort field(s) to query via a JOIN.
	return $order_by_clause;
}