/** * Update import history report * * @param Import $import * @param bool $updateSummary * @return $this */ public function updateReport(Import $import, $updateSummary = false) { if ($import->isReportEntityType()) { $this->load($this->getLastItemId()); $executionResult = self::IMPORT_IN_PROCESS; if ($updateSummary) { $executionResult = $this->reportHelper->getExecutionTime($this->getStartedAt()); $summary = $this->reportHelper->getSummaryStats($import); $this->setSummary($summary); } $this->setExecutionTime($executionResult); $this->save(); } return $this; }
/** * @param ProcessingErrorAggregatorInterface $errorAggregator * @return string */ protected function createErrorReport(ProcessingErrorAggregatorInterface $errorAggregator) { $this->historyModel->loadLastInsertItem(); $sourceFile = $this->reportHelper->getReportAbsolutePath($this->historyModel->getImportedFile()); $writeOnlyErrorItems = true; if ($this->historyModel->getData('execution_time') == ModelHistory::IMPORT_VALIDATION) { $writeOnlyErrorItems = false; } $fileName = $this->reportProcessor->createReport($sourceFile, $errorAggregator, $writeOnlyErrorItems); $this->historyModel->addErrorReportFile($fileName); return $fileName; }
/** * Test getReportSize() */ public function testGetReportSize() { $this->report->getReportSize('file'); }