<?phpnamespace App\Entity;use App\Repository\ResourceRepository;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\File;use Vich\UploaderBundle\Mapping\Annotation as Vich;/** * @Vich\Uploadable() * @ORM\Entity(repositoryClass=ResourceRepository::class) */class Resource{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=1024) */ private $fileName; /** * @var File $file * @Vich\UploadableField(fileNameProperty="fileName", mapping="resources") */ private $file; /** * @ORM\Column(type="datetime_immutable") */ private $updatedAt; /** * @ORM\Column(type="string", length=1024) */ private $originalName; public function getId(): ?int { return $this->id; } public function getFileName(): ?string { return $this->fileName; } public function setFileName(string $fileName): self { $this->fileName = $fileName; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updatedAt; } public function setUpdatedAt(\DateTimeImmutable $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } /** * @return File */ public function getFile() { return $this->file; } /** * @param File $file */ public function setFile(File $file): void { $this->file = $file; if ($file) { $this->updatedAt = new \DateTimeImmutable(); } } public function getOriginalName(): ?string { return $this->originalName; } public function setOriginalName(string $originalName): self { $this->originalName = $originalName; return $this; }}