src/Entity/Quote/QuoteRequestFile.php line 16
<?phpnamespace App\Entity\Quote;use App\Repository\Quote\QuoteRequestFileRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\File;use Vich\UploaderBundle\Mapping\Annotation as Vich;#[ORM\Entity(repositoryClass: QuoteRequestFileRepository::class)]#[ORM\Table(name: 'app_quote_request_file')]#[Vich\Uploadable]class QuoteRequestFile{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\ManyToOne(inversedBy: 'files')]private ?QuoteRequest $quote = null;#[ORM\ManyToOne]private ?RequestFileType $type = null;#[ORM\Column(length: 255, nullable: true)]private ?string $path = null;private ?string $url = null;#[ORM\Column(nullable: true)]private ?int $size = null;#[ORM\Column(length: 50)]private ?string $mimeType = null;#[ORM\Column(length: 255)]private ?string $originalName = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $updatedAt = null;#[ORM\Column(type: Types::ARRAY, nullable: true)]private ?array $dimensions = [];// NOTE: This is not a mapped field of entity metadata, just a simple property.#[Vich\UploadableField(mapping: 'quote_request_file', fileNameProperty: 'path', size: 'size', dimensions: 'dimensions', mimeType: 'mimeType', originalName: 'originalName')]private ?File $file = null;/*** If manually uploading a file (i.e. not using Symfony Form) ensure an instance* of 'UploadedFile' is injected into this setter to trigger the update. If this* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter* must be able to accept an instance of 'File' as the bundle will inject one here* during Doctrine hydration.** @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile*/public function setFile(?File $file = null): void{$this->file = $file;if (null !== $file) {// 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$this->updatedAt = new \DateTimeImmutable();}}public function getFile(): ?File{return $this->file;}public function getId(): ?int{return $this->id;}public function getPath(): ?string{return $this->path;}public function setPath(?string $path): self{$this->path = $path;return $this;}public function getUrl(): ?string{return $this->url;}public function setUrl(string $url): self{$this->url = $url;return $this;}public function getSize(): ?int{return $this->size;}public function setSize(?int $size): self{$this->size = $size;return $this;}public function getMimeType(): ?string{return $this->mimeType;}public function setMimeType(string $mimeType): self{$this->mimeType = $mimeType;return $this;}public function getOriginalName(): ?string{return $this->originalName;}public function setOriginalName(string $originalName): self{$this->originalName = $originalName;return $this;}public function getUpdatedAt(): ?\DateTimeInterface{return $this->updatedAt;}public function setUpdatedAt(?\DateTimeInterface $updatedAt): self{$this->updatedAt = $updatedAt;return $this;}public function getDimensions(): array{return $this->dimensions;}public function setDimensions(?array $dimensions): self{$this->dimensions = $dimensions;return $this;}public function getQuote(): ?QuoteRequest{return $this->quote;}public function setQuote(?QuoteRequest $quote): self{$this->quote = $quote;return $this;}public function getType(): ?RequestFileType{return $this->type;}public function setType(?RequestFileType $type): self{$this->type = $type;return $this;}}