您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

TicketFactory.php 648B

3 年前
3 年前
3 年前
3 年前
3 年前
123456789101112131415161718192021222324
  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. use Lc\SovBundle\Model\Ticket\TicketModel;
  7. class TicketFactory extends AbstractFactory implements TicketFactoryInterface
  8. {
  9. public function create(): TicketInterface
  10. {
  11. $ticket = new Ticket();
  12. $ticketMessageFactory = new TicketMessageFactory();
  13. $ticketMessage = $ticketMessageFactory->create($ticket) ;
  14. $ticket->setStatus(TicketModel::TICKET_STATUS_OPEN);
  15. $ticket->addTicketMessage($ticketMessage) ;
  16. return $ticket;
  17. }
  18. }