src/Entity/MaintenanceType.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MaintenanceTypeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassMaintenanceTypeRepository::class)]
  8. class MaintenanceType
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length50)]
  15.     private ?string $intitule null;
  16.     #[ORM\OneToMany(mappedBy'type'targetEntityMaintenance::class)]
  17.     private Collection $maintenances;
  18.     #[ORM\Column]
  19.     private ?int $typeVehicule null;
  20.     #[ORM\OneToMany(mappedBy'maintenanceType'targetEntityMaintenanceTypePeriodicite::class)]
  21.     private Collection $maintenanceTypePeriodicites;
  22.     #[ORM\ManyToOne(inversedBy'maintenanceTypes')]
  23.     private ?SystemeClient $systemeClient null;
  24.     public function __construct()
  25.     {
  26.         $this->maintenances = new ArrayCollection();
  27.         $this->maintenanceTypePeriodicites = new ArrayCollection();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getIntitule(): ?string
  34.     {
  35.         return $this->intitule;
  36.     }
  37.     public function setIntitule(string $intitule): self
  38.     {
  39.         $this->intitule $intitule;
  40.         return $this;
  41.     }
  42.     /**
  43.      * @return Collection<int, Maintenance>
  44.      */
  45.     public function getMaintenances(): Collection
  46.     {
  47.         return $this->maintenances;
  48.     }
  49.     public function addMaintenance(Maintenance $maintenance): self
  50.     {
  51.         if (!$this->maintenances->contains($maintenance)) {
  52.             $this->maintenances->add($maintenance);
  53.             $maintenance->setType($this);
  54.         }
  55.         return $this;
  56.     }
  57.     public function removeMaintenance(Maintenance $maintenance): self
  58.     {
  59.         if ($this->maintenances->removeElement($maintenance)) {
  60.             // set the owning side to null (unless already changed)
  61.             if ($maintenance->getType() === $this) {
  62.                 $maintenance->setType(null);
  63.             }
  64.         }
  65.         return $this;
  66.     }
  67.     public function __toString()
  68.     {
  69.         return $this->getIntitule();
  70.     }
  71.     public function getTypeVehicule(): ?int
  72.     {
  73.         return $this->typeVehicule;
  74.     }
  75.     public function setTypeVehicule(int $typeVehicule): self
  76.     {
  77.         $this->typeVehicule $typeVehicule;
  78.         return $this;
  79.     }
  80.     /**
  81.      * @return Collection<int, MaintenanceTypePeriodicite>
  82.      */
  83.     public function getMaintenanceTypePeriodicites(): Collection
  84.     {
  85.         return $this->maintenanceTypePeriodicites;
  86.     }
  87.     public function addMaintenanceTypePeriodicite(MaintenanceTypePeriodicite $maintenanceTypePeriodicite): self
  88.     {
  89.         if (!$this->maintenanceTypePeriodicites->contains($maintenanceTypePeriodicite)) {
  90.             $this->maintenanceTypePeriodicites->add($maintenanceTypePeriodicite);
  91.             $maintenanceTypePeriodicite->setMaintenanceType($this);
  92.         }
  93.         return $this;
  94.     }
  95.     public function removeMaintenanceTypePeriodicite(MaintenanceTypePeriodicite $maintenanceTypePeriodicite): self
  96.     {
  97.         if ($this->maintenanceTypePeriodicites->removeElement($maintenanceTypePeriodicite)) {
  98.             // set the owning side to null (unless already changed)
  99.             if ($maintenanceTypePeriodicite->getMaintenanceType() === $this) {
  100.                 $maintenanceTypePeriodicite->setMaintenanceType(null);
  101.             }
  102.         }
  103.         return $this;
  104.     }
  105.     public function getSystemeClient(): ?SystemeClient
  106.     {
  107.         return $this->systemeClient;
  108.     }
  109.     public function setSystemeClient(?SystemeClient $systemeClient): static
  110.     {
  111.         $this->systemeClient $systemeClient;
  112.         return $this;
  113.     }
  114. }