import hiltes

This commit is contained in:
mmoeller
2023-02-02 13:48:54 +01:00
parent 3493e038e3
commit 7100cc5a89
11 changed files with 418 additions and 364 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Command;
use App\Helper\HiltesImport;
use App\Repository\StockRepository;
use App\Repository\WarehouseRepository;
use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
@@ -22,10 +23,12 @@ use Symfony\Component\Finder\Finder;
class HiltesImportCommand extends Command
{
private $stockRepository;
private $warehouseRepository;
private $logger;
public function __construct(StockRepository $stockRepository, LoggerInterface $logger)
public function __construct(StockRepository $stockRepository, WarehouseRepository $warehouseRepository, LoggerInterface $logger)
{
$this->stockRepository = $stockRepository;
$this->warehouseRepository = $warehouseRepository;
$this->logger = $logger;
parent::__construct();
}
@@ -45,14 +48,16 @@ class HiltesImportCommand extends Command
if ($arg1) {
$io->note(sprintf('You passed an argument: %s', $arg1));
}
/**
* @var HiltesImport
*/
$hiltesImport = new HiltesImport($this->stockRepository,$this->logger);
$hiltesImport = new HiltesImport($this->stockRepository,$this->warehouseRepository,$this->logger);
$hiltesImport->startImport();
$io->success('Done.');
return Command::SUCCESS;

View File

@@ -2,6 +2,7 @@
namespace App\Command;
use App\Helper\Shopware;
use App\Repository\StockRepository;
use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Attribute\AsCommand;
@@ -47,13 +48,9 @@ class SwPushStockCommand extends Command
// // ...
// }
$stock = $this->getStock();
$shopware = new Shopware();
if($stock){
}
dump($stock);
$shopware->pushStock();
$io->success('Done.');
@@ -61,9 +58,5 @@ class SwPushStockCommand extends Command
}
public function getStock(){
return $this->stockRepository->findAll();
}
}