<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\MessageinscritRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: MessageinscritRepository::class)]
#[ApiResource]
class Messageinscrit
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $titre = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $message = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $piecejointe = null;
#[ORM\ManyToOne(inversedBy: 'messageinscrits')]
private ?User $user = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $date = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $de = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $vers = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lu = null;
#[ORM\OneToMany(mappedBy: 'msg', targetEntity: Reponsemessage::class,cascade: ['remove'])]
private Collection $reponsemessages;
#[ORM\Column(length: 255, nullable: true)]
private ?string $refid = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lustagiaire = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $luformateur = null;
public function __construct()
{
$this->reponsemessages = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
public function getPiecejointe(): ?string
{
return $this->piecejointe;
}
public function setPiecejointe(?string $piecejointe): self
{
$this->piecejointe = $piecejointe;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(?\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getDe(): ?string
{
return $this->de;
}
public function setDe(?string $de): self
{
$this->de = $de;
return $this;
}
public function getVers(): ?string
{
return $this->vers;
}
public function setVers(?string $vers): self
{
$this->vers = $vers;
return $this;
}
public function getLu(): ?string
{
return $this->lu;
}
public function setLu(?string $lu): self
{
$this->lu = $lu;
return $this;
}
/**
* @return Collection<int, Reponsemessage>
*/
public function getReponsemessages(): Collection
{
return $this->reponsemessages;
}
public function addReponsemessage(Reponsemessage $reponsemessage): self
{
if (!$this->reponsemessages->contains($reponsemessage)) {
$this->reponsemessages->add($reponsemessage);
$reponsemessage->setMsg($this);
}
return $this;
}
public function removeReponsemessage(Reponsemessage $reponsemessage): self
{
if ($this->reponsemessages->removeElement($reponsemessage)) {
// set the owning side to null (unless already changed)
if ($reponsemessage->getMsg() === $this) {
$reponsemessage->setMsg(null);
}
}
return $this;
}
public function getRefid(): ?string
{
return $this->refid;
}
public function setRefid(?string $refid): self
{
$this->refid = $refid;
return $this;
}
public function getLustagiaire(): ?string
{
return $this->lustagiaire;
}
public function setLustagiaire(?string $lustagiaire): self
{
$this->lustagiaire = $lustagiaire;
return $this;
}
public function __toString(): string
{
return $this->getId() ?: $this->getId() ?: 'Untitled Support';
}
public function getLuformateur(): ?string
{
return $this->luformateur;
}
public function setLuformateur(?string $luformateur): self
{
$this->luformateur = $luformateur;
return $this;
}
}