src/Entity/Remorque.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RemorqueRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassRemorqueRepository::class)]
  9. class Remorque
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length50)]
  16.     private ?string $nom null;
  17.     #[ORM\Column]
  18.     private ?int $actif null;
  19.     #[ORM\Column(length50)]
  20.     private ?string $numero null;
  21.     #[ORM\OneToMany(mappedBy'remorque'targetEntityMaintenance::class)]
  22.     private Collection $maintenances;
  23.     #[ORM\Column(length50)]
  24.     private ?string $marque null;
  25.     #[ORM\Column]
  26.     private ?int $genre null;
  27.     #[ORM\Column(length50)]
  28.     private ?string $cat null;
  29.     #[ORM\OneToMany(mappedBy'Remorque'targetEntityFacture::class)]
  30.     private Collection $factures;
  31.     #[ORM\ManyToOne(inversedBy'remorques')]
  32.     private ?SystemeClient $systemeClient null;
  33.     #[ORM\Column(length100)]
  34.     private ?string $referenceMoteur null;
  35.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  36.     private ?\DateTimeInterface $dateImmat null;
  37.     #[ORM\Column]
  38.     private ?int $dureeEntretien null;
  39.     #[ORM\OneToMany(mappedBy'remorque'targetEntityPlanningRemorque::class)]
  40.     private Collection $planningRemorques;
  41.     #[ORM\Column]
  42.     private ?int $nbrEssieux null;
  43.     #[ORM\OneToMany(mappedBy'remorque'targetEntityPneuVehicule::class)]
  44.     private Collection $pneuVehicules;
  45.     #[ORM\ManyToOne(inversedBy'constructeur')]
  46.     private ?Constructeur $constructeur null;
  47.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  48.     private ?\DateTimeInterface $finContratConstructeur null;
  49.     public function __construct()
  50.     {
  51.         $this->maintenances = new ArrayCollection();
  52.         $this->factures = new ArrayCollection();
  53.         $this->planningRemorques = new ArrayCollection();
  54.         $this->pneuVehicules = new ArrayCollection();
  55.     }
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getNom(): ?string
  61.     {
  62.         return $this->nom;
  63.     }
  64.     public function setNom(string $nom): self
  65.     {
  66.         $this->nom $nom;
  67.         return $this;
  68.     }
  69.     /**
  70.      * @return Collection<int, Maintenance>
  71.      */
  72.     public function getMaintenances(): Collection
  73.     {
  74.         return $this->maintenances;
  75.     }
  76.     public function addMaintenance(Maintenance $maintenance): self
  77.     {
  78.         if (!$this->maintenances->contains($maintenance)) {
  79.             $this->maintenances->add($maintenance);
  80.             $maintenance->setRemorque($this);
  81.         }
  82.         return $this;
  83.     }
  84.     public function removeMaintenance(Maintenance $maintenance): self
  85.     {
  86.         if ($this->maintenances->removeElement($maintenance)) {
  87.             // set the owning side to null (unless already changed)
  88.             if ($maintenance->getRemorque() === $this) {
  89.                 $maintenance->setRemorque(null);
  90.             }
  91.         }
  92.         return $this;
  93.     }
  94.     public function getActif(): ?int
  95.     {
  96.         return $this->actif;
  97.     }
  98.     public function setActif(int $actif): self
  99.     {
  100.         $this->actif $actif;
  101.         return $this;
  102.     }
  103.     public function getNumero(): ?string
  104.     {
  105.         return $this->numero;
  106.     }
  107.     public function setNumero(string $numero): self
  108.     {
  109.         $this->numero $numero;
  110.         return $this;
  111.     }
  112.     public function getMarque(): ?string
  113.     {
  114.         return $this->marque;
  115.     }
  116.     public function setMarque(string $marque): self
  117.     {
  118.         $this->marque $marque;
  119.         return $this;
  120.     }
  121.     public function getGenre(): ?int
  122.     {
  123.         return $this->genre;
  124.     }
  125.     public function setGenre(int $genre): self
  126.     {
  127.         $this->genre $genre;
  128.         return $this;
  129.     }
  130.     public function getCat(): ?string
  131.     {
  132.         return $this->cat;
  133.     }
  134.     public function setCat(string $cat): self
  135.     {
  136.         $this->cat $cat;
  137.         return $this;
  138.     }
  139.     public function __toString()
  140.     {
  141.         return $this->getNumero().' ('.$this->getNom().')';
  142.     }
  143.     /**
  144.      * @return Collection<int, Facture>
  145.      */
  146.     public function getFactures(): Collection
  147.     {
  148.         return $this->factures;
  149.     }
  150.     public function addFacture(Facture $facture): self
  151.     {
  152.         if (!$this->factures->contains($facture)) {
  153.             $this->factures->add($facture);
  154.             $facture->setRemorque($this);
  155.         }
  156.         return $this;
  157.     }
  158.     public function removeFacture(Facture $facture): self
  159.     {
  160.         if ($this->factures->removeElement($facture)) {
  161.             // set the owning side to null (unless already changed)
  162.             if ($facture->getRemorque() === $this) {
  163.                 $facture->setRemorque(null);
  164.             }
  165.         }
  166.         return $this;
  167.     }
  168.     public function getSystemeClient(): ?SystemeClient
  169.     {
  170.         return $this->systemeClient;
  171.     }
  172.     public function setSystemeClient(?SystemeClient $systemeClient): self
  173.     {
  174.         $this->systemeClient $systemeClient;
  175.         return $this;
  176.     }
  177.     public function getReferenceMoteur(): ?string
  178.     {
  179.         return $this->referenceMoteur;
  180.     }
  181.     public function setReferenceMoteur(string $referenceMoteur): self
  182.     {
  183.         $this->referenceMoteur $referenceMoteur;
  184.         return $this;
  185.     }
  186.     public function getDateImmat(): ?\DateTimeInterface
  187.     {
  188.         return $this->dateImmat;
  189.     }
  190.     public function setDateImmat(\DateTimeInterface $dateImmat): self
  191.     {
  192.         $this->dateImmat $dateImmat;
  193.         return $this;
  194.     }
  195.     public function getDureeEntretien(): ?int
  196.     {
  197.         return $this->dureeEntretien;
  198.     }
  199.     public function setDureeEntretien(int $dureeEntretien): self
  200.     {
  201.         $this->dureeEntretien $dureeEntretien;
  202.         return $this;
  203.     }
  204.     /**
  205.      * @return Collection<int, PlanningRemorque>
  206.      */
  207.     public function getPlanningRemorques(): Collection
  208.     {
  209.         return $this->planningRemorques;
  210.     }
  211.     public function addPlanningRemorque(PlanningRemorque $planningRemorque): self
  212.     {
  213.         if (!$this->planningRemorques->contains($planningRemorque)) {
  214.             $this->planningRemorques->add($planningRemorque);
  215.             $planningRemorque->setRemorque($this);
  216.         }
  217.         return $this;
  218.     }
  219.     public function removePlanningRemorque(PlanningRemorque $planningRemorque): self
  220.     {
  221.         if ($this->planningRemorques->removeElement($planningRemorque)) {
  222.             // set the owning side to null (unless already changed)
  223.             if ($planningRemorque->getRemorque() === $this) {
  224.                 $planningRemorque->setRemorque(null);
  225.             }
  226.         }
  227.         return $this;
  228.     }
  229.     public function getNbrEssieux(): ?int
  230.     {
  231.         return $this->nbrEssieux;
  232.     }
  233.     public function setNbrEssieux(int $nbrEssieux): static
  234.     {
  235.         $this->nbrEssieux $nbrEssieux;
  236.         return $this;
  237.     }
  238.     /**
  239.      * @return Collection<int, PneuVehicule>
  240.      */
  241.     public function getPneuVehicules(): Collection
  242.     {
  243.         return $this->pneuVehicules;
  244.     }
  245.     public function addPneuVehicule(PneuVehicule $pneuVehicule): static
  246.     {
  247.         if (!$this->pneuVehicules->contains($pneuVehicule)) {
  248.             $this->pneuVehicules->add($pneuVehicule);
  249.             $pneuVehicule->setRemorque($this);
  250.         }
  251.         return $this;
  252.     }
  253.     public function removePneuVehicule(PneuVehicule $pneuVehicule): static
  254.     {
  255.         if ($this->pneuVehicules->removeElement($pneuVehicule)) {
  256.             // set the owning side to null (unless already changed)
  257.             if ($pneuVehicule->getRemorque() === $this) {
  258.                 $pneuVehicule->setRemorque(null);
  259.             }
  260.         }
  261.         return $this;
  262.     }
  263.     public function getConstructeur(): ?Constructeur
  264.     {
  265.         return $this->constructeur;
  266.     }
  267.     public function setConstructeur(?Constructeur $constructeur): static
  268.     {
  269.         $this->constructeur $constructeur;
  270.         return $this;
  271.     }
  272.     public function getFinContratConstructeur(): ?\DateTimeInterface
  273.     {
  274.         return $this->finContratConstructeur;
  275.     }
  276.     public function setFinContratConstructeur(?\DateTimeInterface $finContratConstructeur): self
  277.     {
  278.         $this->finContratConstructeur $finContratConstructeur;
  279.         return $this;
  280.     }
  281. }