<?phpnamespace App\Entity;use App\Repository\BookingEventFileRepository;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\File;use Vich\UploaderBundle\Mapping\Annotation as Vich;#[ORM\Entity(repositoryClass: BookingEventFileRepository::class)]#[Vich\Uploadable]class BookingEventFile{ use IdentifiableTrait; #[ORM\ManyToOne(targetEntity: BookingEvent::class, inversedBy: 'files')] private ?BookingEvent $bookingEvent; #[ORM\Column(type: 'string', nullable: true)] private ?string $fileName = null; #[Vich\UploadableField(mapping: 'booking_event_files', fileNameProperty: 'fileName')] private ?File $file = null; #[ORM\Column(length: 50, nullable: true)] private ?string $name = null; #[ORM\Column] private ?\DateTimeImmutable $updatedAt = null; // Getters and setters public function getId(): ?int { return $this->id; } public function setBookingEvent(?BookingEvent $bookingEvent): self { $this->bookingEvent = $bookingEvent; return $this; } public function getBookingEvent(): ?BookingEvent { return $this->bookingEvent; } public function getFileName(): ?string { return $this->fileName; } public function setFileName(?string $fileName): void { $this->fileName = $fileName; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updatedAt; } public function setUpdatedAt(\DateTimeImmutable $updatedAt): static { $this->updatedAt = $updatedAt; return $this; } public function setFile(?File $file = null): void { $this->file = $file; if (null !== $file) { // Il est nécessaire de mettre à jour l'entité pour que Doctrine écoute les changements $this->updatedAt = new \DateTimeImmutable(); } } public function getFile(): ?File { return $this->file; }}