/** * @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; }
/** * @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); }