protected function setRequestMetrics($request, array $handler)
    {
        if (empty($handler['query']['metrics'])) {
            throw new OutOfRangeException('No query metrics data found in the handler');
        }

        $metrics = array();

        foreach ((array) $handler['query']['metrics'] as $i => $name) {
            $metric = new \Google_Service_AnalyticsReporting_Metric;
            $metric->setExpression($name);
            $metrics[] = $metric;
        }

        $request->setMetrics($metrics);
    }
protected function setRequestMetrics($request, array $handler)
    {
        if (empty($handler['query']['metrics'])) {
            throw new OutOfRangeException('No query metrics data found in the handler');
        }

        $metrics = array();

        foreach ((array) $handler['query']['metrics'] as $i => $name) {
            $metric = new \Google_Service_AnalyticsReporting_Metric;
            $metric->setExpression($name);
            $metrics[] = $metric;
        }

        $request->setMetrics($metrics);
    }
protected function setRequestMetrics ( $ request , array $ handler ) { if ( empty ( $ handler [ 'query' ] [ 'metrics' ] ) ) { throw new OutOfRangeException ( 'No query metrics data found in the handler' ) ; } $ metrics = array ( ) ; foreach ( ( array ) $ handler [ 'query' ] [ 'metrics' ] as $ i => $ name ) { $ metric = new \ Google_Service_AnalyticsReporting_Metric ; $ metric -> setExpression ( $ name ) ; $ metrics [ ] = $ metric ; } $ request -> setMetrics ( $ metrics ) ; }
Sets request metrics from a handler
@param \Google_Service_AnalyticsReporting_ReportRequest $request
@param array $handler
Sets request metrics from a handler