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.

26 lines
718B

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