Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ProductContainer.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. }