<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\ReclamationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ReclamationRepository::class)]
#[ApiResource]
class Reclamation
{
#[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: 'reclamations')]
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\Column(length: 255, nullable: true)]
private ?string $refid = null;
#[ORM\ManyToOne(inversedBy: 'reclamations')]
private ?Evenement $session = null;
#[ORM\OneToMany(mappedBy: 'msg', targetEntity: Reponsereclamation::class,cascade: ['remove'])]
private Collection $reponsereclamations;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lustagiaire = null;
public function __construct()
{
$this->reponsereclamations = 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 string|null
*/
public function getRefid(): ?string
{
return $this->refid;
}
/**
* @param string|null $refid
*/
public function setRefid(?string $refid): void
{
$this->refid = $refid;
}
public function getSession(): ?Evenement
{
return $this->session;
}
public function setSession(?Evenement $session): self
{
$this->session = $session;
return $this;
}
/**
* @return Collection<int, Reponsereclamation>
*/
public function getReponsereclamations(): Collection
{
return $this->reponsereclamations;
}
public function addReponsereclamation(Reponsereclamation $reponsereclamation): self
{
if (!$this->reponsereclamations->contains($reponsereclamation)) {
$this->reponsereclamations->add($reponsereclamation);
$reponsereclamation->setMsg($this);
}
return $this;
}
public function removeReponsereclamation(Reponsereclamation $reponsereclamation): self
{
if ($this->reponsereclamations->removeElement($reponsereclamation)) {
// set the owning side to null (unless already changed)
if ($reponsereclamation->getMsg() === $this) {
$reponsereclamation->setMsg(null);
}
}
return $this;
}
public function getLustagiaire(): ?string
{
return $this->lustagiaire;
}
public function setLustagiaire(?string $lustagiaire): self
{
$this->lustagiaire = $lustagiaire;
return $this;
}
}