<?phpnamespace App\Entity;use App\Repository\FormationRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Symfony\Component\HttpFoundation\File\File;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: FormationRepository::class)]#[Vich\Uploadable]class Formation{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] #[Assert\NotBlank (message:"Le champ ne peut pas être vide.")] private ?string $titre = null; #[ORM\Column(length: 255, nullable: true)] #[Assert\Image( maxSize: '10240k', mimeTypes: ['image/*'], mimeTypesMessage: "Veuillez donner une image" )] private ?string $image = null; #[Vich\UploadableField(mapping: 'formationimage', fileNameProperty: 'image')] public $imageFile; #[ORM\Column(length: 255, nullable: true)] #[Assert\NotBlank (message:"Le champ ne peut pas être vide.")] private ?string $extrait = null; #[ORM\Column(type: Types::TEXT, nullable: true)] #[Assert\NotBlank (message:"Le champ ne peut pas être vide.")] private ?string $description = null; #[ORM\Column(length: 255, nullable: true)] #[Assert\NotBlank (message:"Le champ ne peut pas être vide.")] private ?string $programme = null; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $updatedAt = null; public function __construct() { } public function setImageFile(File $imageFile = null) { $this->imageFile = $imageFile; if (null !== $imageFile) { $this->updatedAt = new \Datetime(); } } public function getImageFile() { return $this->imageFile; } public function __toString() { return $this->titre; } 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 getImage(): ?string { return $this->image; } public function setImage(?string $image): self { $this->image = $image; return $this; } public function getExtrait(): ?string { return $this->extrait; } public function setExtrait(?string $extrait): self { $this->extrait = $extrait; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } public function getProgramme(): ?string { return $this->programme; } public function setProgramme(?string $programme): self { $this->programme = $programme; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; }}