Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ProductContainer.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace Lc\CaracoleBundle\Container\Product;
  3. use Lc\CaracoleBundle\Factory\Product\ProductFactory;
  4. use Lc\CaracoleBundle\Repository\Product\ProductRepositoryQuery;
  5. use Lc\CaracoleBundle\Repository\Product\ProductStore;
  6. use Lc\CaracoleBundle\Solver\Product\ProductSolver;
  7. class ProductContainer
  8. {
  9. protected ProductFactory $factory;
  10. protected ProductSolver $solver;
  11. protected ProductRepositoryQuery $repositoryQuery;
  12. protected ProductStore $store;
  13. public function __construct(
  14. ProductFactory $factory,
  15. ProductSolver $solver,
  16. ProductRepositoryQuery $repositoryQuery,
  17. ProductStore $store
  18. ) {
  19. $this->factory = $factory;
  20. $this->solver = $solver;
  21. $this->repositoryQuery = $repositoryQuery;
  22. $this->store = $store;
  23. }
  24. public function getFactory(): ProductFactory
  25. {
  26. return $this->factory;
  27. }
  28. public function getSolver(): ProductSolver
  29. {
  30. return $this->solver;
  31. }
  32. public function getRepositoryQuery(): ProductRepositoryQuery
  33. {
  34. return $this->repositoryQuery;
  35. }
  36. public function getStore(): ProductStore
  37. {
  38. $this->store->resetContext();
  39. return $this->store;
  40. }
  41. }