<?phpnamespace App\Entity;use App\Repository\IdentiteVisuelleFileRepository;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\File;/** * @Vich\Uploadable */#[ORM\Entity(repositoryClass: IdentiteVisuelleFileRepository::class)]class IdentiteVisuelleFile{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private ?int $id = null; #[ORM\Column(type: 'string', length: 255)] private ?string $categorie = null; #[ORM\Column(type: 'string', length: 255)] private ?string $fileName = null; /** * @Vich\UploadableField(mapping="identite_visuelle_file", fileNameProperty="fileName") * @var File */ private $file; #[ORM\ManyToOne(targetEntity: IdentiteVisuelle::class, inversedBy: 'file')] #[ORM\JoinColumn(nullable: false)] private $identiteVisuelle; #[ORM\Column(type: 'string', length: 255)] private $libelle; #[ORM\Column(type: 'datetime')] private $updatedAt; #[ORM\ManyToOne(targetEntity: IdentiteVisuelleCategory::class, inversedBy: 'identiteVisuelleFiles')] #[ORM\JoinColumn(onDelete: 'SET NULL')] private $identiteVisuelleCategory; public function getId(): ?int { return $this->id; } public function getCategorie(): ?string { return $this->categorie; } public function setCategorie(string $categorie): self { $this->categorie = $categorie; return $this; } public function getFileName(): ?string { return $this->fileName; } public function setFileName(?string $fileName): self { $this->fileName = $fileName; return $this; } public function setFile(?File $file = null) { $this->file = $file; // VERY IMPORTANT: // It is required that at least one field changes if you are using Doctrine, // otherwise the event listeners won't be called and the file is lost if ($file) { // if 'updatedAt' is not defined in your entity, use another property $this->updatedAt = new \DateTime('now'); } } public function getFile() { return $this->file; } public function getIdentiteVisuelle(): ?IdentiteVisuelle { return $this->identiteVisuelle; } public function setIdentiteVisuelle(?IdentiteVisuelle $identiteVisuelle): self { $this->identiteVisuelle = $identiteVisuelle; return $this; } public function getLibelle(): ?string { return $this->libelle; } public function setLibelle(string $libelle): self { $this->libelle = $libelle; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getIdentiteVisuelleCategory(): ?IdentiteVisuelleCategory { return $this->identiteVisuelleCategory; } public function setIdentiteVisuelleCategory(?IdentiteVisuelleCategory $identiteVisuelleCategory): self { $this->identiteVisuelleCategory = $identiteVisuelleCategory; return $this; }}