src/Entity/Formation.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FormationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. #[ORM\Entity(repositoryClassFormationRepository::class)]
  12. #[Vich\Uploadable]
  13. class Formation
  14. {
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column]
  18.     private ?int $id null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     #[Assert\NotBlank (message:"Le champ ne peut pas être vide.")]
  21.     private ?string $titre null;
  22.     #[ORM\Column(length255nullabletrue)]
  23.     #[Assert\Image(
  24.         maxSize'10240k',
  25.         mimeTypes: ['image/*'],
  26.         mimeTypesMessage"Veuillez donner une image"
  27.     )]
  28.     private ?string $image null;
  29.     #[Vich\UploadableField(mapping'formationimage'fileNameProperty'image')]
  30.     public $imageFile;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     #[Assert\NotBlank (message:"Le champ ne peut pas être vide.")]
  33.     private ?string $extrait null;
  34.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  35.     #[Assert\NotBlank (message:"Le champ ne peut pas être vide.")]
  36.     private ?string $description null;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     #[Assert\NotBlank (message:"Le champ ne peut pas être vide.")]
  39.     private ?string $programme null;
  40.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  41.     private ?\DateTimeInterface $updatedAt null;
  42.     public function __construct()
  43.     {
  44.     }
  45.     public function setImageFile(File $imageFile null)
  46.     {
  47.         $this->imageFile $imageFile;
  48.         if (null !== $imageFile) {
  49.             $this->updatedAt = new \Datetime();
  50.         }
  51.     }
  52.     public function getImageFile()
  53.     {
  54.         return $this->imageFile;
  55.     }
  56.     public function __toString()
  57.     {
  58.         return $this->titre;
  59.     }
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getTitre(): ?string
  65.     {
  66.         return $this->titre;
  67.     }
  68.     public function setTitre(?string $titre): self
  69.     {
  70.         $this->titre $titre;
  71.         return $this;
  72.     }
  73.     public function getImage(): ?string
  74.     {
  75.         return $this->image;
  76.     }
  77.     public function setImage(?string $image): self
  78.     {
  79.         $this->image $image;
  80.         return $this;
  81.     }
  82.     public function getExtrait(): ?string
  83.     {
  84.         return $this->extrait;
  85.     }
  86.     public function setExtrait(?string $extrait): self
  87.     {
  88.         $this->extrait $extrait;
  89.         return $this;
  90.     }
  91.     public function getDescription(): ?string
  92.     {
  93.         return $this->description;
  94.     }
  95.     public function setDescription(?string $description): self
  96.     {
  97.         $this->description $description;
  98.         return $this;
  99.     }
  100.     public function getProgramme(): ?string
  101.     {
  102.         return $this->programme;
  103.     }
  104.     public function setProgramme(?string $programme): self
  105.     {
  106.         $this->programme $programme;
  107.         return $this;
  108.     }
  109.     public function getUpdatedAt(): ?\DateTimeInterface
  110.     {
  111.         return $this->updatedAt;
  112.     }
  113.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  114.     {
  115.         $this->updatedAt $updatedAt;
  116.         return $this;
  117.     }
  118. }