This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user