Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

39 lines
1.1KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\Ticket;
  3. use Doctrine\ORM\EntityManagerInterface;
  4. use Lc\CaracoleBundle\Factory\FactoryTrait;
  5. use Lc\CaracoleBundle\Resolver\MerchantResolver;
  6. use Lc\CaracoleBundle\Resolver\SectionResolver;
  7. use Lc\SovBundle\Factory\Ticket\TicketFactory as SovTicketFactory;
  8. use Lc\SovBundle\Factory\Ticket\TicketMessageFactory;
  9. class TicketFactory extends SovTicketFactory
  10. {
  11. // use FactoryTrait;
  12. protected $merchantResolver;
  13. protected $sectionResolver;
  14. protected $ticketMessageFactory;
  15. public function __construct(
  16. EntityManagerInterface $em,
  17. MerchantResolver $merchantResolver,
  18. SectionResolver $sectionResolver,
  19. TicketMessageFactory $ticketMessageFactory
  20. ) {
  21. parent::__construct($em, $ticketMessageFactory);
  22. $this->merchantResolver = $merchantResolver;
  23. $this->sectionResolver = $sectionResolver;
  24. }
  25. public function create($params = array())
  26. {
  27. if (!isset($params['merchant'])) {
  28. $params['merchant'] = $this->merchantResolver->getCurrent();
  29. }
  30. return parent::create($params);
  31. }
  32. }