Journal::getMetricTypes PHP Method

getMetricTypes() public method

Return all metric types supported by this journal.
public getMetricTypes ( $withDisplayNames = false ) : array
return array An array of strings of supported metric type identifiers.
    function getMetricTypes($withDisplayNames = false)
    {
        // Retrieve report plugins enabled for this journal.
        $reportPlugins =& PluginRegistry::loadCategory('reports', true, $this->getId());
        if (!is_array($reportPlugins)) {
            return array();
        }
        // Run through all report plugins and retrieve all supported metrics.
        $metricTypes = array();
        foreach ($reportPlugins as $reportPlugin) {
            $pluginMetricTypes = $reportPlugin->getMetricTypes();
            if ($withDisplayNames) {
                foreach ($pluginMetricTypes as $metricType) {
                    $metricTypes[$metricType] = $reportPlugin->getMetricDisplayType($metricType);
                }
            } else {
                $metricTypes = array_merge($metricTypes, $pluginMetricTypes);
            }
        }
        return $metricTypes;
    }