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.

76 lines
2.1KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Container\Product;
  3. use App\Entity\Product\ProductCategory;
  4. use Lc\CaracoleBundle\Builder\Product\ProductCategoryBuilder;
  5. use Lc\CaracoleBundle\Definition\Field\Product\ProductCategoryFieldDefinition;
  6. use Lc\CaracoleBundle\Factory\Product\ProductCategoryFactory;
  7. use Lc\CaracoleBundle\Repository\Product\ProductCategoryRepositoryQuery;
  8. use Lc\CaracoleBundle\Repository\Product\ProductCategoryStore;
  9. use Lc\CaracoleBundle\Solver\Product\ProductCategorySolver;
  10. class ProductCategoryContainer
  11. {
  12. protected ProductCategoryFactory $factory;
  13. protected ProductCategoryBuilder $builder;
  14. protected ProductCategorySolver $solver;
  15. protected ProductCategoryRepositoryQuery $repositoryQuery;
  16. protected ProductCategoryStore $store;
  17. protected ProductCategoryFieldDefinition $fieldDefinition;
  18. public function __construct(
  19. ProductCategoryFactory $factory,
  20. ProductCategoryBuilder $builder,
  21. ProductCategorySolver $solver,
  22. ProductCategoryRepositoryQuery $repositoryQuery,
  23. ProductCategoryStore $store,
  24. ProductCategoryFieldDefinition $fieldDefinition
  25. ) {
  26. $this->factory = $factory;
  27. $this->builder = $builder;
  28. $this->solver = $solver;
  29. $this->repositoryQuery = $repositoryQuery;
  30. $this->store = $store;
  31. $this->fieldDefinition = $fieldDefinition;
  32. }
  33. public static function getEntityFqcn()
  34. {
  35. return ProductCategory::class;
  36. }
  37. public function getFactory(): ProductCategoryFactory
  38. {
  39. return $this->factory;
  40. }
  41. public function getBuilder(): ProductCategoryBuilder
  42. {
  43. return $this->builder;
  44. }
  45. public function getSolver(): ProductCategorySolver
  46. {
  47. return $this->solver;
  48. }
  49. public function getRepositoryQuery(): ProductCategoryRepositoryQuery
  50. {
  51. return $this->repositoryQuery;
  52. }
  53. public function getStore(): ProductCategoryStore
  54. {
  55. $this->store->resetContext();
  56. return $this->store;
  57. }
  58. public function getFieldDefinition(): ProductCategoryFieldDefinition
  59. {
  60. return $this->fieldDefinition;
  61. }
  62. }