<?php
namespace App\Entity;
use App\Repository\MessagerieRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
/**
* @ORM\Entity(repositoryClass=MessagerieRepository::class)
*/
class Messagerie
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $uuid;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $token;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $statut = false;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $message;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="emetteur")
*/
private $emetteur;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="destinataire")
*/
private $destinataire;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $readAt;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $supp = false;
public $position = false;
/**
* @ORM\ManyToOne(targetEntity=Conversation::class, inversedBy="messageries")
*/
private $conversation;
public function __construct()
{
$this->uuid = Uuid::v4();
}
public function getId(): ?int
{
return $this->id;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(?string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(?string $token): self
{
$this->token = $token;
return $this;
}
public function isStatut(): ?bool
{
return $this->statut;
}
public function setStatut(?bool $statut): self
{
$this->statut = $statut;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
public function getEmetteur(): ?User
{
return $this->emetteur;
}
public function setEmetteur(?User $emetteur): self
{
$this->emetteur = $emetteur;
return $this;
}
public function getDestinataire(): ?User
{
return $this->destinataire;
}
public function setDestinataire(?User $destinataire): self
{
$this->destinataire = $destinataire;
return $this;
}
public function getReadAt(): ?\DateTimeInterface
{
return $this->readAt;
}
public function setReadAt(?\DateTimeInterface $readAt): self
{
$this->readAt = $readAt;
return $this;
}
public function isSupp(): ?bool
{
return $this->supp;
}
public function setSupp(?bool $supp): self
{
$this->supp = $supp;
return $this;
}
public function getConversation(): ?Conversation
{
return $this->conversation;
}
public function setConversation(?Conversation $conversation): self
{
$this->conversation = $conversation;
return $this;
}
}