Piwik\Plugins\API\ProcessedReport::aggregateReportTotalValues PHP Method

aggregateReportTotalValues() private method

private aggregateReportTotalValues ( $simpleDataTable, $totals )
    private function aggregateReportTotalValues($simpleDataTable, $totals)
    {
        $metadataTotals = $simpleDataTable->getMetadata('totals');
        if (empty($metadataTotals)) {
            return $totals;
        }
        $simpleTotals = $this->hideShowMetrics($metadataTotals);
        foreach ($simpleTotals as $metric => $value) {
            if (!array_key_exists($metric, $totals)) {
                $totals[$metric] = $value;
            } else {
                $totals[$metric] += $value;
            }
        }
        return $totals;
    }