Пример #1
0
 /**
  * @param OutputInterface $output
  * @param ImportPart      $part
  */
 protected function runImportPart(OutputInterface $output, ImportPart $part)
 {
     $output->writeln(sprintf('Importing part <comment>%d</comment> of import <comment>%d</comment>', $part->getPosition(), $part->getImport()->getId()));
     $job = $this->importFactory->createImportJob($part);
     $job->setLogger($this->logger);
     $job->run();
 }
Пример #2
0
 /**
  * @param ImportPart               $importPart
  * @param EventDispatcherInterface $dispatcher
  * @param array                    $options
  *
  * @return ReaderInterface
  */
 protected function createImportPartReader(ImportPart $importPart, EventDispatcherInterface $dispatcher, array $options = [])
 {
     $import = $importPart->getImport();
     $transport = $importPart->getTransportConfig();
     $resourceType = ReaderBuilderInterface::RESOURCE_TYPE_PART;
     return $this->createReader($import, $transport, $resourceType, $dispatcher, $options);
 }
Пример #3
0
 /**
  * @param string $message
  */
 protected function fail($message)
 {
     // log the error
     $this->part->setError($message);
     $this->logger->error(sprintf('Importing part %d of import %d failed with message: %s', $this->part->getPosition(), $this->part->getImport()->getId(), $message));
 }