<?phpnamespace App\Entity\Gos;use App\Repository\Gos\AdditionalFileRepository;use Doctrine\ORM\Mapping as ORM;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity(repositoryClass=AdditionalFileRepository::class) * @ORM\HasLifecycleCallbacks() * @Vich\Uploadable() */class AdditionalFile{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $label; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\ManyToOne(targetEntity=ProductVariant::class, inversedBy="additionalFiles") */ private $productVariant; /** * @Vich\UploadableField(mapping="additional_file", fileNameProperty="fileName") * @Assert\File(maxSize="800M") */ private $file; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $fileName; /** @ORM\PrePersist() */ public function onPrePersist(): void { $this->createdAt = new \DateTime(); } /** @ORM\PreUpdate() */ public function onPreUpdate(): void { $this->updatedAt = new \DateTime(); } public function getId(): ?int { return $this->id; } public function getLabel(): ?string { return $this->label; } public function setLabel(string $label): self { $this->label = $label; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getProductVariant(): ?ProductVariant { return $this->productVariant; } public function setProductVariant(?ProductVariant $productVariant): self { $this->productVariant = $productVariant; return $this; } public function getFile(): ?\Symfony\Component\HttpFoundation\File\File { return $this->file; } public function setFile(?\Symfony\Component\HttpFoundation\File\File $file = null): void { $this->file = $file; if (null !== $file) { $this->updatedAt = new \DateTimeImmutable(); } } public function getFileName(): ?string { return $this->fileName; } public function setFileName(?string $fileName): self { $this->fileName = $fileName; return $this; }}