contextId = $contextId; } /** * Execute the job. * */ public function handle() { /** @var ContextDAO $contextDao */ $contextDao = Application::getContextDAO(); /** @var Context $context */ $context = $contextDao->getById($this->contextId); if (!$context) { throw new JobException(JobException::INVALID_PAYLOAD); } // NB: Only run at context level if automatic deposit is enabled. Otherwise, automatic deposit will always run, // regardless of configuration status. if (!$context->getData(Context::SETTING_DOI_AUTOMATIC_DEPOSIT)) { return; } Repo::doi()->depositAll($context); } }