<?php
namespace App\Entity\DirectEmailCommunication;
use App\Entity\ConversationMessage\ConversationMessage;
use App\Utility\GuidUtility;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity()
*
* @ORM\Table(
* name="incoming_direct_email_communication_messages",
* indexes={}
* )
*/
class IncomingDirectEmailCommunicationMessage
{
/**
* @var string
*
* @ORM\GeneratedValue(strategy="CUSTOM")
*
* @ORM\CustomIdGenerator(class="App\Utility\DatabaseIdGenerator")
*
* @ORM\Column(name="id", type="guid")
*
* @ORM\Id
*/
private $id;
public function getId(): string
{
return $this->id;
}
public function setId(string $id): void
{
GuidUtility::validOrThrow($id);
$this->id = $id;
}
/**
* @var OutgoingDirectEmailCommunicationMessage
*
* @ORM\ManyToOne(targetEntity="App\Entity\DirectEmailCommunication\OutgoingDirectEmailCommunicationMessage", inversedBy="incomingDirectEmailCommunicationMessages", cascade={"persist"})
*
* @ORM\JoinColumn(name="outgoing_direct_email_communication_messages_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
private $outgoingDirectEmailCommunicationMessage;
public function getOutgoingDirectEmailCommunicationMessage(): OutgoingDirectEmailCommunicationMessage
{
return $this->outgoingDirectEmailCommunicationMessage;
}
public function setOutgoingDirectEmailCommunicationMessage(OutgoingDirectEmailCommunicationMessage $outgoingDirectEmailCommunicationMessage): void
{
$this->outgoingDirectEmailCommunicationMessage = $outgoingDirectEmailCommunicationMessage;
}
/**
* @var ConversationMessage
*
* @ORM\OneToOne(targetEntity="App\Entity\ConversationMessage\ConversationMessage", inversedBy="incomingDirectEmailCommunicationMessage", cascade={"persist"})
*
* @ORM\JoinColumn(name="conversation_messages_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
private $conversationMessage;
public function getConversationMessage(): ConversationMessage
{
return $this->conversationMessage;
}
public function setConversationMessage(ConversationMessage $conversationMessage): void
{
$this->conversationMessage = $conversationMessage;
}
/**
* @var DateTime
*
* @ORM\Column(name="received_at", type="datetime", nullable=false)
*/
private $receivedAt;
public function getReceivedAt(): DateTime
{
return $this->receivedAt;
}
public function setReceivedAt(DateTime $receivedAt): void
{
$this->receivedAt = $receivedAt;
}
/**
* @var string
*
* @ORM\Column(name="subject", type="string", length=255, nullable=false)
*/
private $subject;
public function getSubject(): string
{
return $this->subject;
}
public function setSubject(string $subject): void
{
$this->subject = mb_substr($subject, 0, 255);
}
/**
* @var string
*
* @ORM\Column(name="body", type="text", nullable=false)
*/
private $body;
public function getBody(): string
{
return $this->body;
}
public function setBody(string $body): void
{
$this->body = mb_substr($body, 0, 65535);
}
/**
* @var string
*
* @ORM\Column(name="extracted_reply", type="string", length=8192, nullable=false)
*/
private $extractedReply;
public function getExtractedReply(): string
{
return $this->extractedReply;
}
public function setExtractedReply(string $extractedReply): void
{
$this->extractedReply = mb_substr($extractedReply, 0, 8192);
}
}