You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 line
1.6KB

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