Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

61 linhas
1.3KB

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