src/Entity/Incident.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\IncidentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. /**
  8.  * @Vich\Uploadable
  9.  */
  10. #[ORM\Entity(repositoryClassIncidentRepository::class)]
  11. class Incident
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column(type'integer')]
  16.     private int $id;
  17.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'incidents')]
  18.     private mixed $user;
  19.     #[ORM\Column(type'datetime'nullabletrue)]
  20.     private mixed $date;
  21.     #[ORM\Column(type'string'length255nullabletrue)]
  22.     private ?string $titrenull;
  23.     #[ORM\Column(type'text'nullabletrue)]
  24.     private ?string $descriptionnull;
  25.     #[ORM\Column(type'string'length255nullabletrue)]
  26.     private ?string $filenamenull;
  27.     /**
  28.      * @Vich\UploadableField(mapping="documents", fileNameProperty="filename")
  29.      */
  30.     private ?\Symfony\Component\HttpFoundation\File\File $file null;
  31.     #[ORM\ManyToOne(targetEntityStatutIncident::class, inversedBy'incidents')]
  32.     private mixed $statut;
  33.     #[ORM\Column(type'datetime'nullabletrue)]
  34.     private mixed $date_update;
  35.     public function setFile(File $file null): void
  36.     {
  37.         $this->file $file;
  38.         if ($file) {
  39.             $date_update = new \DateTime('now');
  40.             $this->date_update $date_update;
  41.         }
  42.     }
  43.     public function getFile(): mixed
  44.     {
  45.         return $this->file;
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getUser(): ?User
  52.     {
  53.         return $this->user;
  54.     }
  55.     public function setUser(?User $user): self
  56.     {
  57.         $this->user $user;
  58.         return $this;
  59.     }
  60.     public function getDate(): ?\DateTimeInterface
  61.     {
  62.         return $this->date;
  63.     }
  64.     public function setDate(?\DateTimeInterface $date): self
  65.     {
  66.         $this->date $date;
  67.         return $this;
  68.     }
  69.     public function getTitre(): ?string
  70.     {
  71.         return $this->titre;
  72.     }
  73.     public function setTitre(?string $titre): self
  74.     {
  75.         $this->titre $titre;
  76.         return $this;
  77.     }
  78.     public function getDescription(): ?string
  79.     {
  80.         return $this->description;
  81.     }
  82.     public function setDescription(?string $description): self
  83.     {
  84.         $this->description $description;
  85.         return $this;
  86.     }
  87.     public function getFilename(): ?string
  88.     {
  89.         return $this->filename;
  90.     }
  91.     public function setFilename(?string $filename): self
  92.     {
  93.         $this->filename $filename;
  94.         return $this;
  95.     }
  96.     public function getStatut(): ?StatutIncident
  97.     {
  98.         return $this->statut;
  99.     }
  100.     public function setStatut(?StatutIncident $statut): self
  101.     {
  102.         $this->statut $statut;
  103.         return $this;
  104.     }
  105.     public function getDateUpdate(): ?\DateTimeInterface
  106.     {
  107.         return $this->date_update;
  108.     }
  109.     public function setDateUpdate(?\DateTimeInterface $date_update): self
  110.     {
  111.         $this->date_update $date_update;
  112.         return $this;
  113.     }
  114. }