getMetricsForTable() 공개 정적인 메소드

Includes ProcessedMetrics and Metrics.
public static getMetricsForTable ( DataTable $dataTable, Report $report = null, string $baseType = 'Piwik\Plugin\Metric' ) : Metric[]
$dataTable Piwik\DataTable
$report Report
$baseType string The base type each metric class needs to be of.
리턴 Metric[]
예제 #1
0
 /**
  * @param DataTable $dataTable
  * @param Report $report
  * @return Metric[]
  */
 private function getMetricsToFormat(DataTable $dataTable, Report $report = null)
 {
     return Report::getMetricsForTable($dataTable, $report, $baseType = 'Piwik\\Plugin\\Metric');
 }
예제 #2
0
 private function addVisualizationInfoFromMetricMetadata()
 {
     $dataTable = $this->dataTable instanceof DataTable\Map ? $this->dataTable->getFirstRow() : $this->dataTable;
     $metrics = Report::getMetricsForTable($dataTable, $this->report);
     // TODO: instead of iterating & calling translate everywhere, maybe we can get all translated names in one place.
     //       may be difficult, though, since translated metrics are specific to the report.
     foreach ($metrics as $metric) {
         $name = $metric->getName();
         if (empty($this->config->translations[$name])) {
             $this->config->translations[$name] = $metric->getTranslatedName();
         }
         if (empty($this->config->metrics_documentation[$name])) {
             $this->config->metrics_documentation[$name] = $metric->getDocumentation();
         }
     }
 }