52 lines
1.8 KiB
PHP
52 lines
1.8 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @file jobs/statistics/CompileCounterSubmissionInstitutionDailyMetrics.php
|
|
*
|
|
* Copyright (c) 2024 Simon Fraser University
|
|
* Copyright (c) 2024 John Willinsky
|
|
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
|
*
|
|
* @class CompileCounterSubmissionInstitutionDailyMetrics
|
|
*
|
|
* @ingroup jobs
|
|
*
|
|
* @brief Compile COUNTER submission institution daily metrics.
|
|
*/
|
|
|
|
namespace APP\jobs\statistics;
|
|
|
|
use APP\statistics\TemporaryItemInvestigationsDAO;
|
|
use APP\statistics\TemporaryItemRequestsDAO;
|
|
use APP\statistics\TemporaryTotalsDAO;
|
|
use PKP\db\DAORegistry;
|
|
use PKP\jobs\BaseJob;
|
|
|
|
class CompileCounterSubmissionInstitutionDailyMetrics extends BaseJob
|
|
{
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @param string $loadId Usage stats log file name
|
|
*/
|
|
public function __construct(protected string $loadId)
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*/
|
|
public function handle(): void
|
|
{
|
|
$temporaryTotalsDao = DAORegistry::getDAO('TemporaryTotalsDAO'); /** @var TemporaryTotalsDAO $temporaryTotalsDao */
|
|
$temporaryItemInvestigationsDao = DAORegistry::getDAO('TemporaryItemInvestigationsDAO'); /** @var TemporaryItemInvestigationsDAO $temporaryItemInvestigationsDao */
|
|
$temporaryItemRequestsDao = DAORegistry::getDAO('TemporaryItemRequestsDAO'); /** @var TemporaryItemRequestsDAO $temporaryItemRequestsDao */
|
|
|
|
$temporaryTotalsDao->deleteCounterSubmissionInstitutionDailyByLoadId($this->loadId); // always call first, before loading the data
|
|
$temporaryTotalsDao->compileCounterSubmissionInstitutionDailyMetrics($this->loadId);
|
|
$temporaryItemInvestigationsDao->compileCounterSubmissionInstitutionDailyMetrics($this->loadId);
|
|
$temporaryItemRequestsDao->compileCounterSubmissionInstitutionDailyMetrics($this->loadId);
|
|
}
|
|
}
|