add fixed export
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Marko
2023-12-13 14:23:45 +01:00
parent c6bc1776bd
commit 047db97928
4 changed files with 26 additions and 26 deletions

View File

@@ -44,9 +44,10 @@ class HiltesImport
/**
* @return void
* @param bool $delta
* @return array
*/
public function startImport($delta = false)
public function startImport(bool $delta = false): array
{
#*** Holt alle Dateien
if ($this->getFiles($delta)) {
@@ -63,18 +64,20 @@ class HiltesImport
}
}
$this->logger->info("Imported $count stocks");
return $this->cachedProdIds;
} else {
$this->logger->info('No Files');
}
} else {
throw new RuntimeException('No Files to Import');
}
return [];
}
/**
* @return bool
*/
protected function getFiles($delta = false): bool
protected function getFiles(bool $delta = false): bool
{
$finder = Finder::create();
$finder
@@ -230,9 +233,9 @@ class HiltesImport
if (empty($product)) {
$product = new Product();
$product->setGtin($gtin);
$this->cachedProdIds[$gtin] = $this->productRepository->save($product, true);
$this->cachedProdIds["$gtin"] = $this->productRepository->save($product, true);
} else {
$this->cachedProdIds[$gtin] = $product->getId();
$this->cachedProdIds["$gtin"] = $product->getId();
}
}