private function getTotalsForAllResults(&$results) {

    $rowCount = count($results->getRows());
    $totalResults = $results->getTotalResults();

    $html = '<h3>Total Metrics For All Results</h3>';
    $html .= "<p>This query returned $rowCount rows. <br>";
    $html .= "But the query matched $totalResults total results. <br>";
    $html .= 'Here are the metric totals for the matched results.</p>';
    $html .= '<pre>';

    $totals = $results->getTotalsForAllResults();
    foreach ($totals as $metricName => $metricTotal) {
      $html .= "Metric Name  = $metricName\n";
      $html .= "Metric Total = $metricTotal";
    }
    $html .= '</pre>';
    return $html;
  }
private function getTotalsForAllResults(&$results) {

    $rowCount = count($results->getRows());
    $totalResults = $results->getTotalResults();

    $html = '<h3>Total Metrics For All Results</h3>';
    $html .= "<p>This query returned $rowCount rows. <br>";
    $html .= "But the query matched $totalResults total results. <br>";
    $html .= 'Here are the metric totals for the matched results.</p>';
    $html .= '<pre>';

    $totals = $results->getTotalsForAllResults();
    foreach ($totals as $metricName => $metricTotal) {
      $html .= "Metric Name  = $metricName\n";
      $html .= "Metric Total = $metricTotal";
    }
    $html .= '</pre>';
    return $html;
  }
private function getTotalsForAllResults ( & $ results ) { $ rowCount = count ( $ results -> getRows ( ) ) ; $ totalResults = $ results -> getTotalResults ( ) ; $ html = '<h3>Total Metrics For All Results</h3>' ; $ html .= "<p>This query returned $rowCount rows. <br>" ; $ html .= "But the query matched $totalResults total results. <br>" ; $ html .= 'Here are the metric totals for the matched results.</p>' ; $ html .= '<pre>' ; $ totals = $ results -> getTotalsForAllResults ( ) ; foreach ( $ totals as $ metricName => $ metricTotal ) { $ html .= "Metric Name  = $metricName\n" ; $ html .= "Metric Total = $metricTotal" ; } $ html .= '</pre>' ; return $ html ; }
Returns the totals for all the results.
@param GaData $results The results from the Core Reporting API.
@return string The formatted results.
Returns the totals for all the results .