<?php
namespace App\Entity;
use App\Repository\AttachmentRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
use DateTime;
use DateTimeZone;
/**
* @ORM\Entity(repositoryClass=AttachmentRepository::class)
* @Vich\Uploadable
*/
class Attachment
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $description;
/**
* @Vich\UploadableField(mapping="vehicle_attachments", fileNameProperty="fileName")
*
* @var File|null
*/
private $attachFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fileName;
/**
* @ORM\ManyToOne(targetEntity=Acquisition::class, inversedBy="attachments")
*/
private $acquisition;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $size;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $originalName;
/**
* @ORM\ManyToOne(targetEntity=ControleTechnique::class, inversedBy="attachments")
*/
private $controleTechnique;
/**
* @ORM\ManyToOne(targetEntity=ControleTachygraphe::class, inversedBy="attachments")
*/
private $controleTachygraphe;
/**
* @ORM\ManyToOne(targetEntity=ControleLimiteurVitesse::class, inversedBy="attachments")
*/
private $controleLimiteurVitesse;
/**
* @ORM\ManyToOne(targetEntity=DocumentDriver::class, inversedBy="attachments")
*/
private $documentDriver;
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 getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getAttachFile(): ?File
{
return $this->attachFile;
}
public function setAttachFile(?File $attachFile = null): void
{
$this->attachFile = $attachFile;
if (null !== $attachFile) {
$parisTimezone = new DateTimeZone('Europe/Paris');
$this->updatedAt = new DateTime('now', $parisTimezone);
}
}
public function getAcquisition(): ?Acquisition
{
return $this->acquisition;
}
public function setAcquisition(?Acquisition $acquisition): self
{
$this->acquisition = $acquisition;
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 getSize(): ?string
{
return $this->size;
}
public function setSize(?string $size): self
{
$this->size = $size;
return $this;
}
public function getOriginalName(): ?string
{
return $this->originalName;
}
public function setOriginalName(?string $originalName): self
{
$this->originalName = $originalName;
return $this;
}
public function getControleTechnique(): ?ControleTechnique
{
return $this->controleTechnique;
}
public function setControleTechnique(?ControleTechnique $controleTechnique): self
{
$this->controleTechnique = $controleTechnique;
return $this;
}
public function getControleTachygraphe(): ?ControleTachygraphe
{
return $this->controleTachygraphe;
}
public function setControleTachygraphe(?ControleTachygraphe $controleTachygraphe): self
{
$this->controleTachygraphe = $controleTachygraphe;
return $this;
}
public function getControleLimiteurVitesse(): ?ControleLimiteurVitesse
{
return $this->controleLimiteurVitesse;
}
public function setControleLimiteurVitesse(?ControleLimiteurVitesse $controleLimiteurVitesse): self
{
$this->controleLimiteurVitesse = $controleLimiteurVitesse;
return $this;
}
public function getDocumentDriver(): ?DocumentDriver
{
return $this->documentDriver;
}
public function setDocumentDriver(?DocumentDriver $documentDriver): self
{
$this->documentDriver = $documentDriver;
return $this;
}
}