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.

29 lines
710B

  1. <?php
  2. namespace Lc\SovBundle\Factory\Ticket;
  3. use App\Entity\Ticket\Ticket;
  4. use Lc\SovBundle\Factory\AbstractFactory;
  5. use Lc\SovBundle\Model\Ticket\TicketInterface;
  6. class TicketFactory extends AbstractFactory implements TicketFactoryInterface
  7. {
  8. protected TicketMessageFactoryInterface $ticketMessageFactory;
  9. public function __construct(TicketMessageFactoryInterface $ticketMessageFactory)
  10. {
  11. $this->ticketMessageFactory = $ticketMessageFactory;
  12. }
  13. public function create(): TicketInterface
  14. {
  15. $ticket = new Ticket();
  16. $ticketMessage = $this->ticketMessageFactory->create() ;
  17. $ticket->addTicketMessage($ticketMessage) ;
  18. return $ticket;
  19. }
  20. }