src/Entity/Certificat.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CertificatRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[ORM\Entity(repositoryClassCertificatRepository::class)]
  10. #[Vich\Uploadable]
  11. class Certificat
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     #[Assert\NotBlank (message:"Le champ Libellé ne peut pas être vide.")]
  19.     private ?string $wording null;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $fileName null;
  22.     #[Vich\UploadableField(mapping'certificat'fileNameProperty'fileName')]
  23.     private ?File $file null;
  24.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  25.     #[Assert\NotBlank (message:"Le Libellé ne peut pas être vide.")]
  26.     private ?\DateTimeInterface $dateObtention null;
  27.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  28.     #[Assert\NotBlank (message:"Le Libellé ne peut pas être vide.")]
  29.     private ?\DateTimeInterface $dateFinValidite null;
  30.     #[ORM\ManyToOne(inversedBy'certificats')]
  31.     #[Assert\NotBlank (message:"Le Libellé ne peut pas être vide.")]
  32.     private ?User $user null;
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function setFile(File $file null)
  38.     {
  39.         $this->file $file;
  40.     }
  41.     public function getFile()
  42.     {
  43.         return $this->file;
  44.     }
  45.     public function getWording(): ?string
  46.     {
  47.         return $this->wording;
  48.     }
  49.     public function __toString()
  50.     {
  51.         return $this->wording;
  52.     }
  53.     public function setWording(?string $wording): self
  54.     {
  55.         $this->wording $wording;
  56.         return $this;
  57.     }
  58.     public function getFileName(): ?string
  59.     {
  60.         return $this->fileName;
  61.     }
  62.     public function setFileName(?string $fileName): self
  63.     {
  64.         $this->fileName $fileName;
  65.         return $this;
  66.     }
  67.     public function getDateObtention(): ?\DateTimeInterface
  68.     {
  69.         return $this->dateObtention;
  70.     }
  71.     public function setDateObtention(?\DateTimeInterface $dateObtention): self
  72.     {
  73.         $this->dateObtention $dateObtention;
  74.         return $this;
  75.     }
  76.     public function getDateFinValidite(): ?\DateTimeInterface
  77.     {
  78.         return $this->dateFinValidite;
  79.     }
  80.     public function setDateFinValidite(
  81.         ?\DateTimeInterface $dateFinValidite
  82.     ): self {
  83.         $this->dateFinValidite $dateFinValidite;
  84.         return $this;
  85.     }
  86.     public function getUser(): ?User
  87.     {
  88.         return $this->user;
  89.     }
  90.     public function setUser(?User $user): self
  91.     {
  92.         $this->user $user;
  93.         return $this;
  94.     }
  95. }