function google_analytics_reports_plugin_query_google_analytics::add_orderby in Google Analytics Reports 7.3
Add SORT attribute to the query.
Parameters
$table: NULL, don't use this.
$field: The metric/dimensions/field
$order: Either '' for ascending or '-' for descending.
$alias: Don't use this yet (at all?).
$params: Don't use this yet (at all?).
File
- plugins/
google_analytics_reports_plugin_query_google_analytics.inc, line 132 - Defines the default query object which builds queries for the Google Analytics Reports API.
Class
- google_analytics_reports_plugin_query_google_analytics
- Object used to create a Google Analytics Core Reporting API query.
Code
function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', $params = array()) {
$this->orderby[] = array(
'field' => $field,
'direction' => strtoupper($order) == 'DESC' ? '-' : '',
);
}