WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Downloads

DataStore::add_order_by() protected WC 1.0

Fills ORDER BY clause of SQL request based on user supplied parameters.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->add_order_by( $query_args );
$query_args(array) (required)
Parameters supplied by the user.

Code of DataStore::add_order_by() WC 5.3.0

<?php
protected function add_order_by( $query_args ) {
	global $wpdb;
	$this->clear_sql_clause( 'order_by' );
	$order_by = '';
	if ( isset( $query_args['orderby'] ) ) {
		$order_by = $this->normalize_order_by( $query_args['orderby'] );
		$this->add_sql_clause( 'order_by', $order_by );
	}

	if ( false !== strpos( $order_by, '_products' ) ) {
		$this->subquery->add_sql_clause( 'join', "JOIN {$wpdb->posts} AS _products ON product_permissions.product_id = _products.ID" );
	}

	$this->add_orderby_order_clause( $query_args, $this );
}