numberOfRecordsPerRun === null) { $this->numberOfRecordsPerRun = $this->importDataProviderService->getTotalRecordCount(); } return $this->numberOfRecordsPerRun; } /** * Checks if this job is enabled. Do perform some checks her if you need to. * E.g. check if a certain extension is loaded or similar. * * @return bool */ public function isEnabled(): bool { return true; } /** * Get job info. * * @return array */ public function getInfo(): array { $totalRecordCount = (int)$this->importDataProviderService->getTotalRecordCount(); $info = [ 'totalRecordCount' => $totalRecordCount, 'runsToComplete' => $totalRecordCount > 0 ? (ceil($totalRecordCount / $this->getNumberOfRecordsPerRun())) : 0, 'increaseOffsetPerRunBy' => $this->getNumberOfRecordsPerRun(), ]; return $info; } /** * The actual run method. * * @param int $offset * * @return void */ public function run($offset) { $importData = $this->importDataProviderService->getImportData($offset, $this->getNumberOfRecordsPerRun()); $this->importService->import($importData, $this->importItemOverwrite, $this->importServiceSettings); } }