src/Entity/PneuVehicule.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PneuVehiculeRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassPneuVehiculeRepository::class)]
  7. class PneuVehicule
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(inversedBy'pneuVehicules')]
  14.     private ?Pneu $pneu null;
  15.     #[ORM\ManyToOne(inversedBy'pneuVehicules')]
  16.     private ?Camion $camion null;
  17.     #[ORM\ManyToOne(inversedBy'pneuVehicules')]
  18.     private ?Remorque $remorque null;
  19.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  20.     private ?\DateTimeInterface $date null;
  21.     #[ORM\Column]
  22.     private ?int $essieu null;
  23.     #[ORM\Column(length2)]
  24.     private ?string $emplacement null;
  25.     #[ORM\Column]
  26.     private ?int $actif null;
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getPneu(): ?Pneu
  32.     {
  33.         return $this->pneu;
  34.     }
  35.     public function setPneu(?Pneu $pneu): static
  36.     {
  37.         $this->pneu $pneu;
  38.         return $this;
  39.     }
  40.     public function getCamion(): ?Camion
  41.     {
  42.         return $this->camion;
  43.     }
  44.     public function setCamion(?Camion $camion): static
  45.     {
  46.         $this->camion $camion;
  47.         return $this;
  48.     }
  49.     public function getRemorque(): ?Remorque
  50.     {
  51.         return $this->remorque;
  52.     }
  53.     public function setRemorque(?Remorque $remorque): static
  54.     {
  55.         $this->remorque $remorque;
  56.         return $this;
  57.     }
  58.     public function getDate(): ?\DateTimeInterface
  59.     {
  60.         return $this->date;
  61.     }
  62.     public function setDate(\DateTimeInterface $date): static
  63.     {
  64.         $this->date $date;
  65.         return $this;
  66.     }
  67.     public function getEssieu(): ?int
  68.     {
  69.         return $this->essieu;
  70.     }
  71.     public function setEssieu(int $essieu): static
  72.     {
  73.         $this->essieu $essieu;
  74.         return $this;
  75.     }
  76.     public function getEmplacementOppose(): ?string
  77.     {
  78.         $emplacement "";
  79.         if (strpos($this->emplacement'D') === false) {
  80.             $emplacement "D";
  81.         } else {
  82.             $emplacement "G";
  83.         }
  84.         if (strpos($this->emplacement'1') === false) {
  85.             $emplacement .= "2";
  86.         } else {
  87.             $emplacement .= "1";
  88.         }
  89.         return $emplacement;
  90.     }
  91.     public function getEmplacementIntitule(): ?string
  92.     {
  93.         $emplacement "";
  94.         if (strpos($this->emplacement'G') === false) {
  95.             $emplacement "droite ";
  96.         } else {
  97.             $emplacement "gauche ";
  98.         }
  99.         if (strpos($this->emplacement'1') === false) {
  100.             $emplacement .= "ext";
  101.         } else {
  102.             $emplacement .= "int";
  103.         }
  104.         return $emplacement;
  105.     }
  106.     public function getEmplacement(): ?string
  107.     {
  108.         return $this->emplacement;
  109.     }
  110.     public function setEmplacement(string $emplacement): static
  111.     {
  112.         $this->emplacement $emplacement;
  113.         return $this;
  114.     }
  115.     public function getActif(): ?int
  116.     {
  117.         return $this->actif;
  118.     }
  119.     public function setActif(int $actif): static
  120.     {
  121.         $this->actif $actif;
  122.         return $this;
  123.     }
  124. }