選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

TicketMessageBuilder.php 799B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace domain\Ticket\TicketMessage;
  3. use domain\Ticket\Ticket\Ticket;
  4. use domain\User\User\User;
  5. use domain\_\AbstractBuilder;
  6. class TicketMessageBuilder extends AbstractBuilder
  7. {
  8. public function instanciateTicketMessage(Ticket $ticket, User $user, string $message = ''): TicketMessage
  9. {
  10. $ticketMessage = new TicketMessage();
  11. $ticketMessage->populateTicket($ticket);
  12. $ticketMessage->populateUser($user);
  13. $ticketMessage->message = $message;
  14. return $ticketMessage;
  15. }
  16. public function createTicketMessage(Ticket $ticket, User $user, string $message): TicketMessage
  17. {
  18. $ticketMessage = $this->instanciateTicketMessage($ticket, $user, $message);
  19. $this->create($ticketMessage);
  20. return $ticketMessage;
  21. }
  22. }