src/Entity/Client.php line 11
<?phpnamespace App\Entity;use App\Repository\ClientRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ClientRepository::class)]class Client{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 100)]private ?string $nom = null;#[ORM\OneToMany(mappedBy: 'client', targetEntity: TransportTheorique::class)]private Collection $transportTheoriques;#[ORM\OneToMany(mappedBy: 'client', targetEntity: TransportReel::class)]private Collection $transportReel;#[ORM\OneToMany(mappedBy: 'client', targetEntity: TransportLieu::class)]private Collection $transportLieus;#[ORM\Column]private ?int $donneurOrdre = null;#[ORM\OneToMany(mappedBy: 'client', targetEntity: Contact::class)]private Collection $contacts;#[ORM\Column]private ?int $actif = null;#[ORM\ManyToOne(inversedBy: 'clients')]private ?SystemeClient $systemeClient = null;#[ORM\OneToMany(mappedBy: 'client', targetEntity: GrilleTarifPalette::class)]private Collection $grilleTarifPalettes;#[ORM\Column(length: 255)]private ?string $siret = null;#[ORM\Column(length: 255)]private ?string $numTVA = null;#[ORM\OneToMany(mappedBy: 'client', targetEntity: GrilleTarifClient::class)]private Collection $grilleTarifClients;#[ORM\OneToMany(mappedBy: 'clientDestination', targetEntity: GrilleTarifClient::class)]private Collection $grilleTarifClientDestinations;#[ORM\OneToMany(mappedBy: 'destination', targetEntity: PaletteMouvement::class)]private Collection $paletteMouvements;public function __construct(){$this->transportTheoriques = new ArrayCollection();$this->transportReel = new ArrayCollection();$this->transportLieus = new ArrayCollection();$this->contacts = new ArrayCollection();$this->grilleTarifPalettes = new ArrayCollection();$this->grilleTarifClients = new ArrayCollection();$this->grilleTarifClientDestinations = new ArrayCollection();$this->paletteMouvements = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getNom(): ?string{return $this->nom;}public function setNom(string $nom): self{$this->nom = $nom;return $this;}/*** @return Collection<int, TransportTheorique>*/public function getTransportTheoriques(): Collection{return $this->transportTheoriques;}public function addTransportTheorique(TransportTheorique $transportTheorique): self{if (!$this->transportTheoriques->contains($transportTheorique)) {$this->transportTheoriques->add($transportTheorique);$transportTheorique->setClient($this);}return $this;}public function removeTransportTheorique(TransportTheorique $transportTheorique): self{if ($this->transportTheoriques->removeElement($transportTheorique)) {// set the owning side to null (unless already changed)if ($transportTheorique->getClient() === $this) {$transportTheorique->setClient(null);}}return $this;}/*** @return Collection<int, TransportReel>*/public function getTransportReel(): Collection{return $this->transportReel;}public function addTransportReel(TransportReel $transportReel): self{if (!$this->transportReel->contains($transportReel)) {$this->transportReel->add($transportReel);$transportReel->setClient($this);}return $this;}public function removeTransportReel(TransportReel $transportReel): self{if ($this->transportReel->removeElement($transportReel)) {// set the owning side to null (unless already changed)if ($transportReel->getClient() === $this) {$transportReel->setClient(null);}}return $this;}/*** @return Collection<int, TransportLieu>*/public function getTransportLieus(): Collection{return $this->transportLieus;}public function addTransportLieu(TransportLieu $transportLieu): self{if (!$this->transportLieus->contains($transportLieu)) {$this->transportLieus->add($transportLieu);$transportLieu->setClient($this);}return $this;}public function removeTransportLieu(TransportLieu $transportLieu): self{if ($this->transportLieus->removeElement($transportLieu)) {// set the owning side to null (unless already changed)if ($transportLieu->getClient() === $this) {$transportLieu->setClient(null);}}return $this;}public function getDonneurOrdre(): ?int{return $this->donneurOrdre;}public function setDonneurOrdre(int $donneurOrdre): self{$this->donneurOrdre = $donneurOrdre;return $this;}/*** @return Collection<int, Contact>*/public function getContacts(): Collection{return $this->contacts;}public function addContact(Contact $contact): self{if (!$this->contacts->contains($contact)) {$this->contacts->add($contact);$contact->setClient($this);}return $this;}public function removeContact(Contact $contact): self{if ($this->contacts->removeElement($contact)) {// set the owning side to null (unless already changed)if ($contact->getClient() === $this) {$contact->setClient(null);}}return $this;}public function __toString(){return $this->getNom();}public function getActif(): ?int{return $this->actif;}public function setActif(int $actif): self{$this->actif = $actif;return $this;}public function getSystemeClient(): ?SystemeClient{return $this->systemeClient;}public function setSystemeClient(?SystemeClient $systemeClient): self{$this->systemeClient = $systemeClient;return $this;}/*** @return Collection<int, GrilleTarifPalette>*/public function getGrilleTarifPalettes(){$list = array();if(!empty($this->grilleTarifPalettes)){foreach($this->grilleTarifPalettes as $grilleTarifPalette){if($grilleTarifPalette->getActif()==1){$list[] = $grilleTarifPalette;}}}return $list;}public function addGrilleTarifPalette(GrilleTarifPalette $grilleTarifPalette): self{if (!$this->grilleTarifPalettes->contains($grilleTarifPalette)) {$this->grilleTarifPalettes->add($grilleTarifPalette);$grilleTarifPalette->setClient($this);}return $this;}public function removeGrilleTarifPalette(GrilleTarifPalette $grilleTarifPalette): self{if ($this->grilleTarifPalettes->removeElement($grilleTarifPalette)) {// set the owning side to null (unless already changed)if ($grilleTarifPalette->getClient() === $this) {$grilleTarifPalette->setClient(null);}}return $this;}public function getGrilleTarif(){$listGTP = array();if(!empty($this->getGrilleTarifPalettes())){foreach($this->getGrilleTarifPalettes() as $grilleTarifPalette){if($grilleTarifPalette->getPaletteId()!=null){if(!isset($listGTP[$grilleTarifPalette->getDestination()->getId()][$grilleTarifPalette->getPaletteId()])){$listGTP[$grilleTarifPalette->getDestination()->getId()][$grilleTarifPalette->getPaletteId()] = 0;}$listGTP[$grilleTarifPalette->getDestination()->getId()][$grilleTarifPalette->getPaletteId()]++;}else{if(!isset($listGTP[$grilleTarifPalette->getDestination()->getId()][0])){$listGTP[$grilleTarifPalette->getDestination()->getId()][0] = 0;}$listGTP[$grilleTarifPalette->getDestination()->getId()][0]++;}}}return $listGTP;}public function getNbrGrilleTarifPalette(){$nbrGTP = 0;if(!empty($this->getGrilleTarifPalettes())){foreach($this->getGrilleTarifPalettes() as $grilleTarifPalette){if($grilleTarifPalette->getActif()==1){$nbrGTP++;}}}return $nbrGTP;}public function getNbrGrilleTarifClient(){$nbrGTC = 0;if(!empty($this->getGrilleTarifClients())){foreach($this->getGrilleTarifClients() as $grilleTarifClient){if($grilleTarifClient->getActif()==1){$nbrGTC++;}}}return $nbrGTC;}public function getGrilleTarifByPaletteAndQte(){$listGTP = array();$listGTPTempo = array();if(!empty($this->getGrilleTarifPalettes())){foreach($this->getGrilleTarifPalettes() as $grilleTarifPalette){if(!empty($grilleTarifPalette->getGrilleTarifPaletteQtes())){foreach($grilleTarifPalette->getGrilleTarifPaletteQtes() as $gtpq){$listGTPTempo[$grilleTarifPalette->getDepart()->getId()][$grilleTarifPalette->getDestination()->getId()][$grilleTarifPalette->getPaletteId()][$gtpq->getQtePalette()] = array('qte'=>$gtpq->getQtePalette(),'prix'=>$gtpq->getPrix());}}}foreach($listGTPTempo as $idDepart => $listGTPTemps){foreach($listGTPTemps as $idDestination => $listGTPTemp){foreach($listGTPTemp as $idPalette => $listGTPTem){ksort($listGTPTem);foreach($listGTPTem as $qte => $listGTPT){$listGTP[$idDepart][$idDestination][$idPalette][$qte] = $listGTPT;}}}}}return $listGTP;}public function getSiret(): ?string{return $this->siret;}public function setSiret(string $siret): self{$this->siret = $siret;return $this;}public function getNumTVA(): ?string{return $this->numTVA;}public function setNumTVA(string $numTVA): self{$this->numTVA = $numTVA;return $this;}/*** @return Collection<int, GrilleTarifClient>*/public function getGrilleTarifClients(): Collection{return $this->grilleTarifClients;}public function addGrilleTarifClient(GrilleTarifClient $grilleTarifClient): self{if (!$this->grilleTarifClients->contains($grilleTarifClient)) {$this->grilleTarifClients->add($grilleTarifClient);$grilleTarifClient->setClient($this);}return $this;}public function removeGrilleTarifClient(GrilleTarifClient $grilleTarifClient): self{if ($this->grilleTarifClients->removeElement($grilleTarifClient)) {// set the owning side to null (unless already changed)if ($grilleTarifClient->getClient() === $this) {$grilleTarifClient->setClient(null);}}return $this;}/*** @return Collection<int, GrilleTarifClient>*/public function getGrilleTarifClientDestinations(): Collection{return $this->grilleTarifClientDestinations;}public function addGrilleTarifClientDestination(GrilleTarifClient $grilleTarifClientDestination): self{if (!$this->grilleTarifClientDestinations->contains($grilleTarifClientDestination)) {$this->grilleTarifClientDestinations->add($grilleTarifClientDestination);$grilleTarifClientDestination->setClientDestination($this);}return $this;}public function removeGrilleTarifClientDestination(GrilleTarifClient $grilleTarifClientDestination): self{if ($this->grilleTarifClientDestinations->removeElement($grilleTarifClientDestination)) {// set the owning side to null (unless already changed)if ($grilleTarifClientDestination->getClientDestination() === $this) {$grilleTarifClientDestination->setClientDestination(null);}}return $this;}/*** @return Collection<int, PaletteMouvement>*/public function getPaletteMouvements(): Collection{return $this->paletteMouvements;}public function addPaletteMouvement(PaletteMouvement $paletteMouvement): static{if (!$this->paletteMouvements->contains($paletteMouvement)) {$this->paletteMouvements->add($paletteMouvement);$paletteMouvement->setDestination($this);}return $this;}public function removePaletteMouvement(PaletteMouvement $paletteMouvement): static{if ($this->paletteMouvements->removeElement($paletteMouvement)) {// set the owning side to null (unless already changed)if ($paletteMouvement->getDestination() === $this) {$paletteMouvement->setDestination(null);}}return $this;}}