本文整理汇总了PHP中Piwik\Plugin\Report::getMetricsForTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::getMetricsForTable方法的具体用法?PHP Report::getMetricsForTable怎么用?PHP Report::getMetricsForTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Plugin\Report
的用法示例。
在下文中一共展示了Report::getMetricsForTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMetricsToFormat
/**
* @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: addVisualizationInfoFromMetricMetadata
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();
}
}
}