PKPUsageStatsPlugin::_downloadStatsCacheMiss PHP Méthode

_downloadStatsCacheMiss() public méthode

Callback to fill cache with data, if empty.
public _downloadStatsCacheMiss ( $cache, $pubObjectId ) : array
$cache FileCache
$pubObjectId int
Résultat array
    function _downloadStatsCacheMiss($cache, $pubObjectId)
    {
        $filter = array(STATISTICS_DIMENSION_SUBMISSION_ID => $pubObjectId, STATISTICS_DIMENSION_ASSOC_TYPE => ASSOC_TYPE_SUBMISSION_FILE);
        $orderBy = array(STATISTICS_DIMENSION_MONTH => STATISTICS_ORDER_ASC);
        $reportPlugin = $this->getReportPlugin();
        $application = PKPApplication::getApplication();
        $statsReports = $application->getMetrics(current($reportPlugin->getMetricTypes()), array(STATISTICS_DIMENSION_MONTH, STATISTICS_DIMENSION_REPRESENTATION_ID), $filter, $orderBy);
        $cache->setEntireCache(array($pubObjectId => $statsReports));
        return $statsReports;
    }