ProductController.php 966 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Controller;
  3. class ProductController
  4. {
  5. public $settingsRepository;
  6. public function __construct($settingsRepository)
  7. {
  8. $this->settingsRepository = $settingsRepository;
  9. }
  10. public function sync()
  11. {
  12. $marketplaceProductRepository = new \MarketplaceRepository\ProductRepository(
  13. $this->settingsRepository->getToken(),
  14. $this->settingsRepository->getShop()
  15. );
  16. $facturisProductRepository = new \Core\FacturisRepository\ProductRepository(
  17. $this->settingsRepository->getAuthApiKey(),
  18. $this->settingsRepository->getAuthUsername(),
  19. $this->settingsRepository->getAuthPassword(),
  20. $this->settingsRepository->getAuthFiscalCode()
  21. );
  22. $service = new \Core\App\Service\ProductService(
  23. $marketplaceProductRepository,
  24. $facturisProductRepository
  25. );
  26. $service->sync();
  27. }
  28. }