<?php
namespace App\Entity;
use App\Repository\ChatMessagesRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ChatMessagesRepository::class)]
class ChatMessages
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Orders::class, inversedBy: 'chatMessages')]
private $orders;
#[ORM\Column(type: 'text')]
private $message;
#[ORM\Column(type: 'boolean')]
private $isDistributor;
#[ORM\Column(type: 'boolean')]
private $isClinic;
#[ORM\Column(type: 'datetime')]
private $modified;
#[ORM\Column(type: 'datetime')]
private $created;
#[ORM\ManyToOne(targetEntity: Distributors::class, inversedBy: 'chatMessages')]
private $distributor;
public function __construct()
{
$this->setModified(new \DateTime());
if ($this->getCreated() == null) {
$this->setCreated(new \DateTime());
}
}
public function getId(): ?int
{
return $this->id;
}
public function getOrders(): ?Orders
{
return $this->orders;
}
public function setOrders(?Orders $orders): self
{
$this->orders = $orders;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(string $message): self
{
$this->message = $message;
return $this;
}
public function getIsDistributor(): ?bool
{
return $this->isDistributor;
}
public function setIsDistributor(bool $isDistributor): self
{
$this->isDistributor = $isDistributor;
return $this;
}
public function getIsClinic(): ?bool
{
return $this->isClinic;
}
public function setIsClinic(bool $isClinic): self
{
$this->isClinic = $isClinic;
return $this;
}
public function getModified(): ?\DateTimeInterface
{
return $this->modified;
}
public function setModified(\DateTimeInterface $modified): self
{
$this->modified = $modified;
return $this;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
public function getDistributor(): ?Distributors
{
return $this->distributor;
}
public function setDistributor(?Distributors $distributor): self
{
$this->distributor = $distributor;
return $this;
}
}