Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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. }