<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity()
*/
class CarSaleDocument
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=CarSale::class, inversedBy="documents")
* @ORM\JoinColumn(name="car_sale_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
private $carSale;
/**
* @ORM\Column(type="string", length=100)
*/
private $type;
/**
* @ORM\Column(type="string", length=255)
*/
private $fileName;
/**
* @ORM\Column(type="string", length=500)
*/
private $filePath;
/**
* @ORM\Column(type="string", length=100, nullable=true, options={"default":"application/pdf"})
*/
private $mimeType = 'application/pdf';
/**
* @ORM\Column(type="bigint", nullable=true)
*/
private $sizeBytes;
/**
* @ORM\Column(type="string", length=64, nullable=true)
*/
private $sha256;
/**
* @ORM\Column(type="string", length=10, options={"default":"ACTIVE"})
*/
private $status = 'ACTIVE';
/**
* @ORM\Column(type="integer", options={"default":1})
*/
private $version = 1;
/**
* @ORM\Column(type="datetime")
*/
private $uploadedAt;
public function __construct()
{
$this->uploadedAt = new \DateTimeImmutable();
}
// -------- Getters/Setters --------
public function getId(): ?int { return $this->id; }
public function getCarSale(): ?CarSale { return $this->carSale; }
public function setCarSale(?CarSale $carSale): self { $this->carSale = $carSale; return $this; }
public function getType(): ?string { return $this->type; }
public function setType(string $type): self { $this->type = $type; return $this; }
public function getFileName(): ?string { return $this->fileName; }
public function setFileName(string $fileName): self { $this->fileName = $fileName; return $this; }
public function getFilePath(): ?string { return $this->filePath; }
public function setFilePath(string $filePath): self { $this->filePath = $filePath; return $this; }
public function getMimeType(): ?string { return $this->mimeType; }
public function setMimeType(?string $mimeType): self { $this->mimeType = $mimeType; return $this; }
public function getSizeBytes(): ?int { return $this->sizeBytes; }
public function setSizeBytes(?int $sizeBytes): self { $this->sizeBytes = $sizeBytes; return $this; }
public function getSha256(): ?string { return $this->sha256; }
public function setSha256(?string $sha256): self { $this->sha256 = $sha256; return $this; }
public function getStatus(): string { return $this->status; }
public function setStatus(string $status): self { $this->status = $status; return $this; }
public function getVersion(): int { return $this->version; }
public function setVersion(int $version): self { $this->version = $version; return $this; }
public function getUploadedAt(): \DateTimeInterface { return $this->uploadedAt; }
public function setUploadedAt(\DateTimeInterface $uploadedAt): self { $this->uploadedAt = $uploadedAt; return $this; }
}