|
|
@@ -178,15 +178,17 @@ class ImportExcelCommand extends Command |
|
|
foreach ($rows as $row) { |
|
|
foreach ($rows as $row) { |
|
|
$data = array_combine($headers, $row); |
|
|
$data = array_combine($headers, $row); |
|
|
|
|
|
|
|
|
// Prüfe, ob ShippingCompany bereits existiert |
|
|
|
|
|
$existingCompany = $this->entityManager->getRepository(ShippingCompany::class) |
|
|
|
|
|
->findOneBy(['code' => $data['code']]); |
|
|
|
|
|
|
|
|
if ($data['name'] !== null) { |
|
|
|
|
|
// Prüfe, ob ShippingCompany bereits existiert |
|
|
|
|
|
$existingCompany = $this->entityManager->getRepository(ShippingCompany::class) |
|
|
|
|
|
->findOneBy(['code' => $data['code']]); |
|
|
|
|
|
|
|
|
if (!$existingCompany) { |
|
|
|
|
|
$company = new ShippingCompany($data['name'], $data['code']); |
|
|
|
|
|
|
|
|
if (!$existingCompany) { |
|
|
|
|
|
$company = new ShippingCompany($data['name'], $data['code']); |
|
|
|
|
|
|
|
|
$this->entityManager->persist($company); |
|
|
|
|
|
$count++; |
|
|
|
|
|
|
|
|
$this->entityManager->persist($company); |
|
|
|
|
|
$count++; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|