<?phpnamespace App\Entity\Gos\Consultant;use App\Repository\Gos\Consultant\ConsultantMessageRepository;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity(repositoryClass=ConsultantMessageRepository::class) * @ORM\HasLifecycleCallbacks() */class ConsultantMessage{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity=ConsultantRoomQueue::class, inversedBy="consultantMessages") * @ORM\JoinColumn(onDelete="SET NULL") */ private $consultantRoomQueue; /** * @ORM\ManyToOne(targetEntity=ConsultantRoom::class, inversedBy="consultantMessages") * @ORM\JoinColumn(onDelete="SET NULL") */ private $consultantRoom; /** * @ORM\ManyToOne(targetEntity=ConsultantHistory::class, inversedBy="consultantMessages") */ private $consultantHistory; /** * @ORM\Column(type="string", length=255) * @Assert\NotBlank(message="Wprowadź wiadomość") * @Assert\Length(max=255, maxMessage="Przekroczono maksymalną liczbę {{ limit }} znaków") */ private $content; /** * @ORM\Column(type="boolean", options={"default": false}) */ private $isConsultantMessage = false; /** * @ORM\Column(type="datetime") */ private $createdAt; /** @ORM\PrePersist() */ public function prePersist() { $this->createdAt = new \DateTime(); } public function getId(): ?int { return $this->id; } public function getConsultantRoomQueue(): ?ConsultantRoomQueue { return $this->consultantRoomQueue; } public function setConsultantRoomQueue(?ConsultantRoomQueue $consultantRoomQueue): self { $this->consultantRoomQueue = $consultantRoomQueue; return $this; } public function getConsultantRoom(): ?ConsultantRoom { return $this->consultantRoom; } public function setConsultantRoom(?ConsultantRoom $consultantRoom): self { $this->consultantRoom = $consultantRoom; return $this; } public function getConsultantHistory(): ?ConsultantHistory { return $this->consultantHistory; } public function setConsultantHistory(?ConsultantHistory $consultantHistory): self { $this->consultantHistory = $consultantHistory; return $this; } public function getContent(): ?string { return $this->content; } public function setContent(string $content): self { $this->content = $content; return $this; } public function getIsConsultantMessage(): ?bool { return $this->isConsultantMessage; } public function setIsConsultantMessage(bool $isConsultantMessage): self { $this->isConsultantMessage = $isConsultantMessage; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; }}