Journal::getDefaultMetricType PHP Méthode

getDefaultMetricType() public méthode

If no specific metric type has been set for this journal then the site-wide default metric type will be returned.
public getDefaultMetricType ( ) : null | string
Résultat null | string A metric type identifier or null if no default metric type could be identified.
    function getDefaultMetricType()
    {
        $defaultMetricType = $this->getSetting('defaultMetricType');
        // Check whether the selected metric type is valid.
        $availableMetrics = $this->getMetricTypes();
        if (empty($defaultMetricType)) {
            if (count($availableMetrics) === 1) {
                // If there is only a single available metric then use it.
                $defaultMetricType = $availableMetrics[0];
            } else {
                // Use the site-wide default metric.
                $application = PKPApplication::getApplication();
                $defaultMetricType = $application->getDefaultMetricType();
            }
        } else {
            if (!in_array($defaultMetricType, $availableMetrics)) {
                return null;
            }
        }
        return $defaultMetricType;
    }