public function executeBatchCommand($presetName, $partName, $dataProviderClassName, $importerClassName, $currentImportIdentifier, $offset = null, $batchSize = null)
    {
        try {
            $vault = new Vault($presetName);

            $dataProviderOptions = Arrays::getValueByPath($this->settings, ['presets', $presetName, 'parts', $partName, 'dataProviderOptions']);
            $dataProviderOptions['__presetName'] = $presetName;
            $dataProviderOptions['__partName'] = $partName;

            /** @var DataProviderInterface $dataProvider */
            $dataProvider = $dataProviderClassName::create(is_array($dataProviderOptions) ? $dataProviderOptions : [], $offset, $batchSize);

            $importerOptions = Arrays::getValueByPath($this->settings, ['presets', $presetName, 'parts', $partName, 'importerOptions']);

            /** @var AbstractImporter $importer */
            $importerOptions = is_array($importerOptions) ? $importerOptions : [];
            $importerOptions['__presetName'] = $presetName;
            $importerOptions['__partName'] = $partName;
            $importer = $this->objectManager->get($importerClassName, $importerOptions, $currentImportIdentifier, $vault);
            $importer->getImportService()->addEventMessage(sprintf('%s:Batch:Started', $importerClassName), sprintf('%s batch started (%s)', $importerClassName, $dataProviderClassName));
            $importer->initialize($dataProvider);
            $importer->process();
            $importer->getImportService()->addEventMessage(sprintf('%s:Batch:Ended', $importerClassName), sprintf('%s batch ended (%s)', $importerClassName, $dataProviderClassName));
            $this->output($importer->getProcessedRecords());
        } catch (\Exception $exception) {
            $this->logger->logException($exception);
            $this->outputLine('<error>%s</error>', [$exception->getMessage()]);
            $this->sendAndExit(1);
        }
    }
public function executeBatchCommand($presetName, $partName, $dataProviderClassName, $importerClassName, $currentImportIdentifier, $offset = null, $batchSize = null)
    {
        try {
            $vault = new Vault($presetName);

            $dataProviderOptions = Arrays::getValueByPath($this->settings, ['presets', $presetName, 'parts', $partName, 'dataProviderOptions']);
            $dataProviderOptions['__presetName'] = $presetName;
            $dataProviderOptions['__partName'] = $partName;

            /** @var DataProviderInterface $dataProvider */
            $dataProvider = $dataProviderClassName::create(is_array($dataProviderOptions) ? $dataProviderOptions : [], $offset, $batchSize);

            $importerOptions = Arrays::getValueByPath($this->settings, ['presets', $presetName, 'parts', $partName, 'importerOptions']);

            /** @var AbstractImporter $importer */
            $importerOptions = is_array($importerOptions) ? $importerOptions : [];
            $importerOptions['__presetName'] = $presetName;
            $importerOptions['__partName'] = $partName;
            $importer = $this->objectManager->get($importerClassName, $importerOptions, $currentImportIdentifier, $vault);
            $importer->getImportService()->addEventMessage(sprintf('%s:Batch:Started', $importerClassName), sprintf('%s batch started (%s)', $importerClassName, $dataProviderClassName));
            $importer->initialize($dataProvider);
            $importer->process();
            $importer->getImportService()->addEventMessage(sprintf('%s:Batch:Ended', $importerClassName), sprintf('%s batch ended (%s)', $importerClassName, $dataProviderClassName));
            $this->output($importer->getProcessedRecords());
        } catch (\Exception $exception) {
            $this->logger->logException($exception);
            $this->outputLine('<error>%s</error>', [$exception->getMessage()]);
            $this->sendAndExit(1);
        }
    }
public function executeBatchCommand ( $ presetName , $ partName , $ dataProviderClassName , $ importerClassName , $ currentImportIdentifier , $ offset = null , $ batchSize = null ) { try { $ vault = new Vault ( $ presetName ) ; $ dataProviderOptions = Arrays :: getValueByPath ( $ this -> settings , [ 'presets' , $ presetName , 'parts' , $ partName , 'dataProviderOptions' ] ) ; $ dataProviderOptions [ '__presetName' ] = $ presetName ; $ dataProviderOptions [ '__partName' ] = $ partName ; /** @var DataProviderInterface $dataProvider */ $ dataProvider = $ dataProviderClassName :: create ( is_array ( $ dataProviderOptions ) ? $ dataProviderOptions : [ ] , $ offset , $ batchSize ) ; $ importerOptions = Arrays :: getValueByPath ( $ this -> settings , [ 'presets' , $ presetName , 'parts' , $ partName , 'importerOptions' ] ) ; /** @var AbstractImporter $importer */ $ importerOptions = is_array ( $ importerOptions ) ? $ importerOptions : [ ] ; $ importerOptions [ '__presetName' ] = $ presetName ; $ importerOptions [ '__partName' ] = $ partName ; $ importer = $ this -> objectManager -> get ( $ importerClassName , $ importerOptions , $ currentImportIdentifier , $ vault ) ; $ importer -> getImportService ( ) -> addEventMessage ( sprintf ( '%s:Batch:Started' , $ importerClassName ) , sprintf ( '%s batch started (%s)' , $ importerClassName , $ dataProviderClassName ) ) ; $ importer -> initialize ( $ dataProvider ) ; $ importer -> process ( ) ; $ importer -> getImportService ( ) -> addEventMessage ( sprintf ( '%s:Batch:Ended' , $ importerClassName ) , sprintf ( '%s batch ended (%s)' , $ importerClassName , $ dataProviderClassName ) ) ; $ this -> output ( $ importer -> getProcessedRecords ( ) ) ; } catch ( \ Exception $ exception ) { $ this -> logger -> logException ( $ exception ) ; $ this -> outputLine ( '<error>%s</error>' , [ $ exception -> getMessage ( ) ] ) ; $ this -> sendAndExit ( 1 ) ; } }
Import a single batch

This internal command is called by executeCommand() and runs an isolated import for a batch as specified by
the command's arguments.

@param string $presetName
@param string $partName
@param string $dataProviderClassName
@param string $importerClassName
@param string $currentImportIdentifier
@param integer $offset
@param integer $batchSize
@return void
@Flow\Internal
Import a single batch