PKPUsageStatsPlugin::getAllDownloadsStats PHP Méthode

getAllDownloadsStats() public méthode

Retrieve the allDownloads dataset from the download stats
public getAllDownloadsStats ( $pubObjectId, $stats = [] )
$pubObjectId int ID of the object to get stats for
$stats array Optionally pass in stats that have already been fetched from _getDownloadStats().
    function getAllDownloadsStats($pubObjectId, $stats = array())
    {
        if (empty($stats)) {
            $stats = $this->_getDownloadStats($pubObjectId);
        }
        $allDownloadStats = array();
        foreach ($stats as $dataset) {
            if (array_key_exists('allDownloads', $dataset)) {
                $allDownloadStats = $dataset['allDownloads'];
            }
        }
        return $allDownloadStats;
    }