src/Entity/ControleTachygraphe.php line 14

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