protected function setRequestSorting($request, array $handler)
    {
        if (!empty($handler['query']['sort'])) {

            $orders = array();
            foreach ((array) $handler['query']['sort'] as $field => $params) {

                $params += array('VALUE', 'ASCENDING');

                list($type, $direction) = array_map('strtoupper', $params);

                $order = new \Google_Service_AnalyticsReporting_OrderBy;

                $order->setFieldName($field);
                $order->setOrderType($type);
                $order->setSortOrder($direction);

                $orders[] = $order;
            }

            $request->setOrderBys($orders);
        }
    }