<?php
namespace App\Entity;
use App\Entity\TimestampableTrait;
use App\Repository\ControleTechniqueRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ControleTechniqueRepository::class)
*/
class ControleTechnique
{
use TimestampableTrait;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Transporteur::class, inversedBy="controleTechniques")
*/
private $transporteur;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $startDate;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $endDate;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $company;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $pvNumber;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $pvResult;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $infos;
/**
* @ORM\ManyToOne(targetEntity=Vehicle::class, inversedBy="controleTechniques")
*/
private $vehicle;
/**
* @ORM\OneToMany(targetEntity=Attachment::class, mappedBy="controleTechnique", orphanRemoval=true, cascade={"persist"})
*/
private $attachments;
public function __construct()
{
$this->attachments = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTransporteur(): ?Transporteur
{
return $this->transporteur;
}
public function setTransporteur(?Transporteur $transporteur): self
{
$this->transporteur = $transporteur;
return $this;
}
public function getStartDate(): ?\DateTimeInterface
{
return $this->startDate;
}
public function setStartDate(?\DateTimeInterface $startDate): self
{
$this->startDate = $startDate;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->endDate;
}
public function setEndDate(?\DateTimeInterface $endDate): self
{
$this->endDate = $endDate;
return $this;
}
public function getCompany(): ?string
{
return $this->company;
}
public function setCompany(?string $company): self
{
$this->company = $company;
return $this;
}
public function getPvNumber(): ?string
{
return $this->pvNumber;
}
public function setPvNumber(?string $pvNumber): self
{
$this->pvNumber = $pvNumber;
return $this;
}
public function getPvResult(): ?string
{
return $this->pvResult;
}
public function setPvResult(?string $pvResult): self
{
$this->pvResult = $pvResult;
return $this;
}
public function getInfos(): ?string
{
return $this->infos;
}
public function setInfos(?string $infos): self
{
$this->infos = $infos;
return $this;
}
public function getVehicle(): ?Vehicle
{
return $this->vehicle;
}
public function setVehicle(?Vehicle $vehicle): self
{
$this->vehicle = $vehicle;
return $this;
}
/**
* @return Collection<int, Attachment>
*/
public function getAttachments(): Collection
{
return $this->attachments;
}
public function addAttachment(Attachment $attachment): self
{
if (!$this->attachments->contains($attachment)) {
$this->attachments[] = $attachment;
$attachment->setControleTechnique($this);
}
return $this;
}
public function removeAttachment(Attachment $attachment): self
{
if ($this->attachments->removeElement($attachment)) {
// set the owning side to null (unless already changed)
if ($attachment->getControleTechnique() === $this) {
$attachment->setControleTechnique(null);
}
}
return $this;
}
}