<?php
namespace App\Entity;
use App\Repository\FirmQualiNegoceDocumentRepository;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
use Serializable;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
#[ORM\Entity(repositoryClass: FirmQualiNegoceDocumentRepository::class)]
#[Vich\Uploadable]
class FirmQualiNegoceDocument implements TimestampableInterface, Serializable
{
use TimestampableTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[Vich\UploadableField(mapping: 'quali_negoce', fileNameProperty: 'file', size: 'size', originalName: 'originalFileName')]
private ?File $documentFile = null;
#[ORM\Column(length: 255)]
private ?string $file = null;
#[ORM\Column(nullable: true)]
private ?float $size = null;
#[ORM\ManyToOne(inversedBy: 'firmQualiNegoceDocuments')]
#[ORM\JoinColumn(nullable: false)]
private ?Entreprise $firm = null;
#[ORM\Column(length: 255)]
private ?string $originalFileName = null;
public function getId(): ?int
{
return $this->id;
}
public function setDocumentFile(?File $documentFile = null): void
{
$this->documentFile = $documentFile;
if (null !== $documentFile) {
$this->updatedAt = new \DateTimeImmutable();
}
}
public function getDocumentFile(): ?File
{
return $this->documentFile;
}
public function getFile(): ?string
{
return $this->file;
}
public function setFile(?string $file): self
{
$this->file = $file;
return $this;
}
public function getSize(): ?float
{
return $this->size;
}
public function setSize(?float $size): self
{
$this->size = $size;
return $this;
}
public function getFirm(): ?Entreprise
{
return $this->firm;
}
public function setFirm(?Entreprise $firm): self
{
$this->firm = $firm;
return $this;
}
public function getOriginalFileName(): ?string
{
return $this->originalFileName;
}
public function setOriginalFileName(?string $originalFileName): self
{
$this->originalFileName = $originalFileName;
return $this;
}
public function serialize()
{
return serialize(array(
$this->id,
$this->file,
$this->size,
// $this->firm,
$this->originalFileName,
));
}
public function unserialize($serialized)
{
list (
$this->id,
$this->file,
$this->size,
// $this->firm,
$this->originalFileName,
) = unserialize($serialized);
}
}