src/Entity/SystemeClient.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SystemeClientRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassSystemeClientRepository::class)]
  8. class SystemeClient
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $nom null;
  16.     #[ORM\OneToMany(mappedBy'systemeClient'targetEntityUser::class)]
  17.     private Collection $users;
  18.     #[ORM\OneToMany(mappedBy'systemeClient'targetEntityRemorque::class)]
  19.     private Collection $remorques;
  20.     #[ORM\OneToMany(mappedBy'systemeClient'targetEntityCamion::class)]
  21.     private Collection $camions;
  22.     #[ORM\OneToMany(mappedBy'systemeClient'targetEntityMaintenance::class)]
  23.     private Collection $maintenances;
  24.     #[ORM\OneToMany(mappedBy'systemeClient'targetEntityTourneeTheorique::class)]
  25.     private Collection $tourneeTheoriques;
  26.     #[ORM\OneToMany(mappedBy'systemeClient'targetEntityClient::class)]
  27.     private Collection $clients;
  28.     #[ORM\OneToMany(mappedBy'systemeClient'targetEntityPneu::class)]
  29.     private Collection $pneus;
  30.     #[ORM\OneToMany(mappedBy'SystemeClient'targetEntityMaintenanceType::class)]
  31.     private Collection $maintenanceTypes;
  32.     public function __construct()
  33.     {
  34.         $this->users = new ArrayCollection();
  35.         $this->remorques = new ArrayCollection();
  36.         $this->camions = new ArrayCollection();
  37.         $this->maintenances = new ArrayCollection();
  38.         $this->tourneeTheoriques = new ArrayCollection();
  39.         $this->clients = new ArrayCollection();
  40.         $this->maintenanceTypes = new ArrayCollection();
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getNom(): ?string
  47.     {
  48.         return $this->nom;
  49.     }
  50.     public function setNom(string $nom): self
  51.     {
  52.         $this->nom $nom;
  53.         return $this;
  54.     }
  55.     /**
  56.      * @return Collection<int, User>
  57.      */
  58.     public function getUsers(): Collection
  59.     {
  60.         return $this->users;
  61.     }
  62.     public function addUser(User $user): self
  63.     {
  64.         if (!$this->users->contains($user)) {
  65.             $this->users->add($user);
  66.             $user->setSystemeClient($this);
  67.         }
  68.         return $this;
  69.     }
  70.     public function removeUser(User $user): self
  71.     {
  72.         if ($this->users->removeElement($user)) {
  73.             // set the owning side to null (unless already changed)
  74.             if ($user->getSystemeClient() === $this) {
  75.                 $user->setSystemeClient(null);
  76.             }
  77.         }
  78.         return $this;
  79.     }
  80.     /**
  81.      * @return Collection<int, Remorque>
  82.      */
  83.     public function getRemorques(): Collection
  84.     {
  85.         return $this->remorques;
  86.     }
  87.     public function addRemorque(Remorque $remorque): self
  88.     {
  89.         if (!$this->remorques->contains($remorque)) {
  90.             $this->remorques->add($remorque);
  91.             $remorque->setSystemeClient($this);
  92.         }
  93.         return $this;
  94.     }
  95.     public function removeRemorque(Remorque $remorque): self
  96.     {
  97.         if ($this->remorques->removeElement($remorque)) {
  98.             // set the owning side to null (unless already changed)
  99.             if ($remorque->getSystemeClient() === $this) {
  100.                 $remorque->setSystemeClient(null);
  101.             }
  102.         }
  103.         return $this;
  104.     }
  105.     /**
  106.      * @return Collection<int, Camion>
  107.      */
  108.     public function getCamions(): Collection
  109.     {
  110.         return $this->camions;
  111.     }
  112.     public function addCamion(Camion $camion): self
  113.     {
  114.         if (!$this->camions->contains($camion)) {
  115.             $this->camions->add($camion);
  116.             $camion->setSystemeClient($this);
  117.         }
  118.         return $this;
  119.     }
  120.     public function removeCamion(Camion $camion): self
  121.     {
  122.         if ($this->camions->removeElement($camion)) {
  123.             // set the owning side to null (unless already changed)
  124.             if ($camion->getSystemeClient() === $this) {
  125.                 $camion->setSystemeClient(null);
  126.             }
  127.         }
  128.         return $this;
  129.     }
  130.     /**
  131.      * @return Collection<int, Maintenance>
  132.      */
  133.     public function getMaintenances(): Collection
  134.     {
  135.         return $this->maintenances;
  136.     }
  137.     public function addMaintenance(Maintenance $maintenance): self
  138.     {
  139.         if (!$this->maintenances->contains($maintenance)) {
  140.             $this->maintenances->add($maintenance);
  141.             $maintenance->setSystemeClient($this);
  142.         }
  143.         return $this;
  144.     }
  145.     public function removeMaintenance(Maintenance $maintenance): self
  146.     {
  147.         if ($this->maintenances->removeElement($maintenance)) {
  148.             // set the owning side to null (unless already changed)
  149.             if ($maintenance->getSystemeClient() === $this) {
  150.                 $maintenance->setSystemeClient(null);
  151.             }
  152.         }
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return Collection<int, TourneeTheorique>
  157.      */
  158.     public function getTourneeTheoriques(): Collection
  159.     {
  160.         return $this->tourneeTheoriques;
  161.     }
  162.     public function addTourneeTheorique(TourneeTheorique $tourneeTheorique): self
  163.     {
  164.         if (!$this->tourneeTheoriques->contains($tourneeTheorique)) {
  165.             $this->tourneeTheoriques->add($tourneeTheorique);
  166.             $tourneeTheorique->setSystemeClient($this);
  167.         }
  168.         return $this;
  169.     }
  170.     public function removeTourneeTheorique(TourneeTheorique $tourneeTheorique): self
  171.     {
  172.         if ($this->tourneeTheoriques->removeElement($tourneeTheorique)) {
  173.             // set the owning side to null (unless already changed)
  174.             if ($tourneeTheorique->getSystemeClient() === $this) {
  175.                 $tourneeTheorique->setSystemeClient(null);
  176.             }
  177.         }
  178.         return $this;
  179.     }
  180.     public function __toString()
  181.     {
  182.         return $this->getNom();
  183.     }
  184.     /**
  185.      * @return Collection<int, Client>
  186.      */
  187.     public function getClients(): Collection
  188.     {
  189.         return $this->clients;
  190.     }
  191.     public function addClient(Client $client): self
  192.     {
  193.         if (!$this->clients->contains($client)) {
  194.             $this->clients->add($client);
  195.             $client->setSystemeClient($this);
  196.         }
  197.         return $this;
  198.     }
  199.     public function removeClient(Client $client): self
  200.     {
  201.         if ($this->clients->removeElement($client)) {
  202.             // set the owning side to null (unless already changed)
  203.             if ($client->getSystemeClient() === $this) {
  204.                 $client->setSystemeClient(null);
  205.             }
  206.         }
  207.         return $this;
  208.     }
  209.     /**
  210.      * @return Collection<int, Pneu>
  211.      */
  212.     public function getPneus(): Collection
  213.     {
  214.         return $this->pneus;
  215.     }
  216.     public function addPneu(Pneu $pneu): static
  217.     {
  218.         if (!$this->pneus->contains($pneu)) {
  219.             $this->pneus->add($pneu);
  220.             $pneu->setSystemeClient($this);
  221.         }
  222.         return $this;
  223.     }
  224.     public function removePneu(Pneu $pneu): static
  225.     {
  226.         if ($this->pneus->removeElement($pneu)) {
  227.             // set the owning side to null (unless already changed)
  228.             if ($pneu->getSystemeClient() === $this) {
  229.                 $pneu->setSystemeClient(null);
  230.             }
  231.         }
  232.         return $this;
  233.     }
  234.     /**
  235.      * @return Collection<int, MaintenanceType>
  236.      */
  237.     public function getMaintenanceTypes(): Collection
  238.     {
  239.         return $this->maintenanceTypes;
  240.     }
  241.     public function addMaintenanceType(MaintenanceType $maintenanceType): static
  242.     {
  243.         if (!$this->maintenanceTypes->contains($maintenanceType)) {
  244.             $this->maintenanceTypes->add($maintenanceType);
  245.             $maintenanceType->setSystemeClient($this);
  246.         }
  247.         return $this;
  248.     }
  249.     public function removeMaintenanceType(MaintenanceType $maintenanceType): static
  250.     {
  251.         if ($this->maintenanceTypes->removeElement($maintenanceType)) {
  252.             // set the owning side to null (unless already changed)
  253.             if ($maintenanceType->getSystemeClient() === $this) {
  254.                 $maintenanceType->setSystemeClient(null);
  255.             }
  256.         }
  257.         return $this;
  258.     }
  259. }