<?php
namespace App\Entity;
use App\Repository\MessagesRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: MessagesRepository::class)]
class Messages
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'messages')]
private ?User $sender = null;
#[ORM\ManyToOne(inversedBy: 'messages')]
private ?User $recipient = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $title = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $message = null;
#[ORM\Column(type: 'datetime', nullable: true)]
private $created_at;
#[ORM\Column(nullable: true)]
private ?bool $is_read = null;
#[ORM\ManyToOne(inversedBy: 'messages')]
private ?Annonces $annonce = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $chat = null;
public function __construct()
{
$this->created_at = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getSender(): ?User
{
return $this->sender;
}
public function setSender(?User $sender): self
{
$this->sender = $sender;
return $this;
}
public function getRecipient(): ?User
{
return $this->recipient;
}
public function setRecipient(?User $recipient): self
{
$this->recipient = $recipient;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(?\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function isIsRead(): ?bool
{
return $this->is_read;
}
public function setIsRead(?bool $is_read): self
{
$this->is_read = $is_read;
return $this;
}
public function getAnnonce(): ?Annonces
{
return $this->annonce;
}
public function setAnnonce(?Annonces $annonce): self
{
$this->annonce = $annonce;
return $this;
}
public function getChat(): ?string
{
return $this->chat;
}
public function setChat(?string $chat): self
{
$this->chat = $chat;
return $this;
}
}