src/Entity/ControleTechnique.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\TimestampableTrait;
  4. use App\Repository\ControleTechniqueRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=ControleTechniqueRepository::class)
  10.  */
  11. class ControleTechnique
  12. {
  13.     use TimestampableTrait;
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity=Transporteur::class, inversedBy="controleTechniques")
  22.      */
  23.     private $transporteur;
  24.     /**
  25.      * @ORM\Column(type="datetime", nullable=true)
  26.      */
  27.     private $startDate;
  28.     /**
  29.      * @ORM\Column(type="datetime", nullable=true)
  30.      */
  31.     private $endDate;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true)
  34.      */
  35.     private $company;
  36.     /**
  37.      * @ORM\Column(type="string", length=255, nullable=true)
  38.      */
  39.     private $pvNumber;
  40.     /**
  41.      * @ORM\Column(type="string", length=255, nullable=true)
  42.      */
  43.     private $pvResult;
  44.     /**
  45.      * @ORM\Column(type="text", nullable=true)
  46.      */
  47.     private $infos;
  48.     /**
  49.      * @ORM\ManyToOne(targetEntity=Vehicle::class, inversedBy="controleTechniques")
  50.      */
  51.     private $vehicle;
  52.     /**
  53.      * @ORM\OneToMany(targetEntity=Attachment::class, mappedBy="controleTechnique", orphanRemoval=true, cascade={"persist"})
  54.      */
  55.     private $attachments;
  56.     public function __construct()
  57.     {
  58.         $this->attachments = new ArrayCollection();
  59.     }
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getTransporteur(): ?Transporteur
  65.     {
  66.         return $this->transporteur;
  67.     }
  68.     public function setTransporteur(?Transporteur $transporteur): self
  69.     {
  70.         $this->transporteur $transporteur;
  71.         return $this;
  72.     }
  73.     public function getStartDate(): ?\DateTimeInterface
  74.     {
  75.         return $this->startDate;
  76.     }
  77.     public function setStartDate(?\DateTimeInterface $startDate): self
  78.     {
  79.         $this->startDate $startDate;
  80.         return $this;
  81.     }
  82.     public function getEndDate(): ?\DateTimeInterface
  83.     {
  84.         return $this->endDate;
  85.     }
  86.     public function setEndDate(?\DateTimeInterface $endDate): self
  87.     {
  88.         $this->endDate $endDate;
  89.         return $this;
  90.     }
  91.     public function getCompany(): ?string
  92.     {
  93.         return $this->company;
  94.     }
  95.     public function setCompany(?string $company): self
  96.     {
  97.         $this->company $company;
  98.         return $this;
  99.     }
  100.     public function getPvNumber(): ?string
  101.     {
  102.         return $this->pvNumber;
  103.     }
  104.     public function setPvNumber(?string $pvNumber): self
  105.     {
  106.         $this->pvNumber $pvNumber;
  107.         return $this;
  108.     }
  109.     public function getPvResult(): ?string
  110.     {
  111.         return $this->pvResult;
  112.     }
  113.     public function setPvResult(?string $pvResult): self
  114.     {
  115.         $this->pvResult $pvResult;
  116.         return $this;
  117.     }
  118.     public function getInfos(): ?string
  119.     {
  120.         return $this->infos;
  121.     }
  122.     public function setInfos(?string $infos): self
  123.     {
  124.         $this->infos $infos;
  125.         return $this;
  126.     }
  127.     public function getVehicle(): ?Vehicle
  128.     {
  129.         return $this->vehicle;
  130.     }
  131.     public function setVehicle(?Vehicle $vehicle): self
  132.     {
  133.         $this->vehicle $vehicle;
  134.         return $this;
  135.     }
  136.     /**
  137.      * @return Collection<int, Attachment>
  138.      */
  139.     public function getAttachments(): Collection
  140.     {
  141.         return $this->attachments;
  142.     }
  143.     public function addAttachment(Attachment $attachment): self
  144.     {
  145.         if (!$this->attachments->contains($attachment)) {
  146.             $this->attachments[] = $attachment;
  147.             $attachment->setControleTechnique($this);
  148.         }
  149.         return $this;
  150.     }
  151.     public function removeAttachment(Attachment $attachment): self
  152.     {
  153.         if ($this->attachments->removeElement($attachment)) {
  154.             // set the owning side to null (unless already changed)
  155.             if ($attachment->getControleTechnique() === $this) {
  156.                 $attachment->setControleTechnique(null);
  157.             }
  158.         }
  159.         return $this;
  160.     }
  161. }