src/App/Entity/DirectEmailCommunication/IncomingDirectEmailCommunicationMessage.php line 18

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\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity()
  9. *
  10. * @ORM\Table(
  11. * name="incoming_direct_email_communication_messages",
  12. * indexes={}
  13. * )
  14. */
  15. class IncomingDirectEmailCommunicationMessage
  16. {
  17. /**
  18. * @var string
  19. *
  20. * @ORM\GeneratedValue(strategy="CUSTOM")
  21. *
  22. * @ORM\CustomIdGenerator(class="App\Utility\DatabaseIdGenerator")
  23. *
  24. * @ORM\Column(name="id", type="guid")
  25. *
  26. * @ORM\Id
  27. */
  28. private $id;
  29. public function getId(): string
  30. {
  31. return $this->id;
  32. }
  33. public function setId(string $id): void
  34. {
  35. GuidUtility::validOrThrow($id);
  36. $this->id = $id;
  37. }
  38. /**
  39. * @var OutgoingDirectEmailCommunicationMessage
  40. *
  41. * @ORM\ManyToOne(targetEntity="App\Entity\DirectEmailCommunication\OutgoingDirectEmailCommunicationMessage", inversedBy="incomingDirectEmailCommunicationMessages", cascade={"persist"})
  42. *
  43. * @ORM\JoinColumn(name="outgoing_direct_email_communication_messages_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  44. */
  45. private $outgoingDirectEmailCommunicationMessage;
  46. public function getOutgoingDirectEmailCommunicationMessage(): OutgoingDirectEmailCommunicationMessage
  47. {
  48. return $this->outgoingDirectEmailCommunicationMessage;
  49. }
  50. public function setOutgoingDirectEmailCommunicationMessage(OutgoingDirectEmailCommunicationMessage $outgoingDirectEmailCommunicationMessage): void
  51. {
  52. $this->outgoingDirectEmailCommunicationMessage = $outgoingDirectEmailCommunicationMessage;
  53. }
  54. /**
  55. * @var ConversationMessage
  56. *
  57. * @ORM\OneToOne(targetEntity="App\Entity\ConversationMessage\ConversationMessage", inversedBy="incomingDirectEmailCommunicationMessage", cascade={"persist"})
  58. *
  59. * @ORM\JoinColumn(name="conversation_messages_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  60. */
  61. private $conversationMessage;
  62. public function getConversationMessage(): ConversationMessage
  63. {
  64. return $this->conversationMessage;
  65. }
  66. public function setConversationMessage(ConversationMessage $conversationMessage): void
  67. {
  68. $this->conversationMessage = $conversationMessage;
  69. }
  70. /**
  71. * @var DateTime
  72. *
  73. * @ORM\Column(name="received_at", type="datetime", nullable=false)
  74. */
  75. private $receivedAt;
  76. public function getReceivedAt(): DateTime
  77. {
  78. return $this->receivedAt;
  79. }
  80. public function setReceivedAt(DateTime $receivedAt): void
  81. {
  82. $this->receivedAt = $receivedAt;
  83. }
  84. /**
  85. * @var string
  86. *
  87. * @ORM\Column(name="subject", type="string", length=255, nullable=false)
  88. */
  89. private $subject;
  90. public function getSubject(): string
  91. {
  92. return $this->subject;
  93. }
  94. public function setSubject(string $subject): void
  95. {
  96. $this->subject = mb_substr($subject, 0, 255);
  97. }
  98. /**
  99. * @var string
  100. *
  101. * @ORM\Column(name="body", type="text", nullable=false)
  102. */
  103. private $body;
  104. public function getBody(): string
  105. {
  106. return $this->body;
  107. }
  108. public function setBody(string $body): void
  109. {
  110. $this->body = mb_substr($body, 0, 65535);
  111. }
  112. /**
  113. * @var string
  114. *
  115. * @ORM\Column(name="extracted_reply", type="string", length=8192, nullable=false)
  116. */
  117. private $extractedReply;
  118. public function getExtractedReply(): string
  119. {
  120. return $this->extractedReply;
  121. }
  122. public function setExtractedReply(string $extractedReply): void
  123. {
  124. $this->extractedReply = mb_substr($extractedReply, 0, 8192);
  125. }
  126. }