/** * @param array $batch * @param \Symfony\Component\Console\Helper\ProgressBar $progressBar * @param \Generated\Shared\Transfer\LocaleTransfer $locale * @param \Spryker\Zed\Collector\Business\Exporter\Writer\TouchUpdaterInterface $touchUpdater * @param \Spryker\Zed\Collector\Business\Model\BatchResultInterface $batchResult * @param \Spryker\Zed\Collector\Business\Exporter\Writer\WriterInterface $storeWriter * * @return void */ protected function processBatchForExport(array $batch, ProgressBar $progressBar, LocaleTransfer $locale, TouchUpdaterInterface $touchUpdater, BatchResultInterface $batchResult, WriterInterface $storeWriter) { $batchSize = count($batch); $progressBar->advance($batchSize); $touchUpdaterSet = new TouchUpdaterSet(CollectorConfig::COLLECTOR_TOUCH_ID); $collectedData = $this->collectData($batch, $locale, $touchUpdaterSet); $collectedDataCount = count($collectedData); $touchUpdater->bulkUpdate($touchUpdaterSet, $locale->getIdLocale(), $this->touchQueryContainer->getConnection()); $storeWriter->write($collectedData); $batchResult->increaseProcessedCount($collectedDataCount); }
/** * @param string $exportType * @param \Generated\Shared\Transfer\LocaleTransfer $locale * @param \DateTime $timestamp * * @return void */ public function setLastExportMarkByTypeAndLocale($exportType, LocaleTransfer $locale, \DateTime $timestamp) { $timestampKey = $this->keyBuilder->generateKey($exportType, $locale->getLocaleName()); $this->writer->write([$timestampKey => $timestamp->format('Y-m-d H:i:s')]); }