src/App/Entity/DirectEmailCommunication/OutgoingDirectEmailCommunicationMessage.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\DirectEmailCommunication;
  3. use App\Entity\ConversationMessage\ConversationMessage;
  4. use App\Utility\GuidUtility;
  5. use DateTime;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9. * @ORM\Entity()
  10. *
  11. * @ORM\Table(
  12. * name="outgoing_direct_email_communication_messages",
  13. * indexes={}
  14. * )
  15. */
  16. class OutgoingDirectEmailCommunicationMessage
  17. {
  18. /**
  19. * @var string
  20. *
  21. * @ORM\GeneratedValue(strategy="CUSTOM")
  22. *
  23. * @ORM\CustomIdGenerator(class="App\Utility\DatabaseIdGenerator")
  24. *
  25. * @ORM\Column(name="id", type="guid")
  26. *
  27. * @ORM\Id
  28. */
  29. private $id;
  30. public function getId(): string
  31. {
  32. return $this->id;
  33. }
  34. public function setId(string $id): void
  35. {
  36. GuidUtility::validOrThrow($id);
  37. $this->id = $id;
  38. }
  39. /**
  40. * @var ConversationMessage
  41. *
  42. * @ORM\OneToOne(targetEntity="App\Entity\ConversationMessage\ConversationMessage", inversedBy="outgoingDirectEmailCommunicationMessage", cascade={"persist"})
  43. *
  44. * @ORM\JoinColumn(name="conversation_messages_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  45. */
  46. private $conversationMessage;
  47. public function getConversationMessage(): ConversationMessage
  48. {
  49. return $this->conversationMessage;
  50. }
  51. public function setConversationMessage(ConversationMessage $conversationMessage): void
  52. {
  53. $this->conversationMessage = $conversationMessage;
  54. }
  55. /**
  56. * @var IncomingDirectEmailCommunicationMessage|Collection
  57. *
  58. * @ORM\OneToMany(targetEntity="App\Entity\DirectEmailCommunication\IncomingDirectEmailCommunicationMessage", mappedBy="outgoingDirectEmailCommunicationMessage", cascade={"persist", "remove"})
  59. */
  60. private $incomingDirectEmailCommunicationMessages;
  61. public function getIncomingDirectEmailCommunicationMessages(): Collection
  62. {
  63. return $this->incomingDirectEmailCommunicationMessages;
  64. }
  65. public function setIncomingDirectEmailCommunicationMessages(Collection $incomingDirectEmailCommunicationMessages): void
  66. {
  67. $this->incomingDirectEmailCommunicationMessages = $incomingDirectEmailCommunicationMessages;
  68. }
  69. /** @var string */
  70. private $receiverEmailAddress;
  71. public function getReceiverEmailAddress(): string
  72. {
  73. return $this->receiverEmailAddress;
  74. }
  75. public function setReceiverEmailAddress(string $receiverEmailAddress): void
  76. {
  77. $this->receiverEmailAddress = $receiverEmailAddress;
  78. }
  79. /**
  80. * @var DateTime
  81. *
  82. * @ORM\Column(name="sent_at", type="datetime", nullable=false)
  83. */
  84. private $sentAt;
  85. public function getSentAt(): DateTime
  86. {
  87. return $this->sentAt;
  88. }
  89. public function setSentAt(DateTime $sentAt): void
  90. {
  91. $this->sentAt = $sentAt;
  92. }
  93. /**
  94. * @var string
  95. *
  96. * @ORM\Column(name="subject", type="string", length=255, nullable=false)
  97. */
  98. private $subject;
  99. public function getSubject(): string
  100. {
  101. return $this->subject;
  102. }
  103. public function setSubject(string $subject): void
  104. {
  105. $this->subject = mb_substr($subject, 0, 255, 'UTF-8');
  106. }
  107. /**
  108. * @var string
  109. *
  110. * @ORM\Column(name="body", type="string", length=8192, nullable=false)
  111. */
  112. private $body;
  113. public function getBody(): string
  114. {
  115. return $this->body;
  116. }
  117. public function setBody(string $body): void
  118. {
  119. $this->body = mb_substr($body, 0, 8192, 'UTF-8');
  120. }
  121. }