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.

57 lines
1.5KB

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