/**
  * @param ImportPart $part
  *
  * @return bool
  */
 protected function validate(ImportPart $part)
 {
     // validate that we have a valid transport config
     try {
         TransportFactory::createTransportFromConfig($part->getTransportConfig());
     } catch (\RuntimeException $e) {
         $part->setError($e->getMessage());
         return false;
     }
     return true;
 }
Beispiel #2
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));
 }
 /**
  * @param ImportPart $part
  */
 public function startImportPart(ImportPart $part)
 {
     $part->setError(null);
     $part->setDatetimeStarted(new \DateTime());
     $this->savePart($part);
 }