src/Entity/Client.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClientRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. #[ORM\Entity(repositoryClassClientRepository::class)]
  9. #[UniqueEntity(fields: ['email'], message'There is already an account with this email')]
  10. class Client
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(length255nullabletrue)]
  17.     private ?string $email null;
  18.     #[ORM\Column(length255 nullabletrue)]
  19.     private ?string $nom null;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $prenom null;
  22.     #[ORM\Column(length255uniquetrue)]
  23.     private ?string $raisonsocial null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $adresse null;
  26.     #[ORM\Column(length255nullabletrue)]
  27.     private ?string $tel null;
  28.     #[ORM\OneToMany(mappedBy'client'targetEntityIntervention::class, cascade: ["remove"])]
  29.     private Collection $intervention;
  30.     #[ORM\ManyToOne(inversedBy'clients'cascade: ["remove"])]
  31.     #[ORM\JoinColumn(nullabletrue)]
  32.     private ?Fraisdeliv $region null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $photo null;
  35.     #[ORM\OneToMany(mappedBy'client'targetEntityDevis::class, cascade: ["remove"])]
  36.     private Collection $devis;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $faxclient null;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $mfclient null;
  41.     #[ORM\OneToMany(mappedBy'client'targetEntityGestionmachines::class, cascade: ["remove"])]
  42.     private Collection $gestionmachines;
  43.     #[ORM\Column(nullabletrue)]
  44.     private ?bool $exoneres null;
  45.     #[ORM\OneToMany(mappedBy'client'targetEntityImportdirect::class, cascade: ["remove"])]
  46.     private Collection $importdirects;
  47.     #[ORM\OneToMany(mappedBy'client'targetEntityCommissions::class, cascade: ["remove"])]
  48.     private Collection $commissions;
  49.     #[ORM\OneToMany(mappedBy'client'targetEntityHistoriquedemandedevis::class, cascade: ["remove"])]
  50.     private Collection $historiquedemandedevis;
  51.     #[ORM\OneToMany(mappedBy'client'targetEntityHistoriqueintervention::class, cascade: ["remove"])]
  52.     private Collection $historiqueinterventions;
  53.     #[ORM\OneToMany(mappedBy'client'targetEntityBondesortie::class)]
  54.     private Collection $bondesorties;
  55.     public function __toString(): string
  56.     {
  57.         return $this->raisonsocial;
  58.     }
  59.     public function __construct()
  60.     {
  61.         $this->intervention = new ArrayCollection();
  62.         $this->devis = new ArrayCollection();
  63.         $this->gestionmachines = new ArrayCollection();
  64.         $this->importdirects = new ArrayCollection();
  65.         $this->commissions = new ArrayCollection();
  66.         $this->historiquedemandedevis = new ArrayCollection();
  67.         $this->historiqueinterventions = new ArrayCollection();
  68.         $this->bondesorties = new ArrayCollection();
  69.     }
  70.     public function getNom(): ?string
  71.     {
  72.         return $this->nom;
  73.     }
  74.     public function getId(): ?int
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function getEmail(): ?string
  79.     {
  80.         return $this->email;
  81.     }
  82.     public function setEmail(?string $email): void
  83.     {
  84.         $this->email $email;
  85.     }
  86.     public function setNom(string $nom): self
  87.     {
  88.         $this->nom $nom;
  89.         return $this;
  90.     }
  91.     public function getPrenom(): ?string
  92.     {
  93.         return $this->prenom;
  94.     }
  95.     public function setPrenom(string $prenom): self
  96.     {
  97.         $this->prenom $prenom;
  98.         return $this;
  99.     }
  100.     public function getRaisonsocial(): ?string
  101.     {
  102.         return $this->raisonsocial;
  103.     }
  104.     public function setRaisonsocial(string $raisonsocial): self
  105.     {
  106.         $this->raisonsocial $raisonsocial;
  107.         return $this;
  108.     }
  109.     public function getAdresse(): ?string
  110.     {
  111.         return $this->adresse;
  112.     }
  113.     public function setAdresse(string $adresse): self
  114.     {
  115.         $this->adresse $adresse;
  116.         return $this;
  117.     }
  118.     public function getTel(): ?string
  119.     {
  120.         return $this->tel;
  121.     }
  122.     public function setTel(string $tel): self
  123.     {
  124.         $this->tel $tel;
  125.         return $this;
  126.     }
  127.     /**
  128.      * @return Collection<int, Intervention>
  129.      */
  130.     public function getIntervention(): Collection
  131.     {
  132.         return $this->intervention;
  133.     }
  134.     public function addIntervention(Intervention $intervention): self
  135.     {
  136.         if (!$this->intervention->contains($intervention)) {
  137.             $this->intervention->add($intervention);
  138.             $intervention->setClient($this);
  139.         }
  140.         return $this;
  141.     }
  142.     public function removeIntervention(Intervention $intervention): self
  143.     {
  144.         if ($this->intervention->removeElement($intervention)) {
  145.             // set the owning side to null (unless already changed)
  146.             if ($intervention->getClient() === $this) {
  147.                 $intervention->setClient(null);
  148.             }
  149.         }
  150.         return $this;
  151.     }
  152.     public function getRegion(): ?Fraisdeliv
  153.     {
  154.         return $this->region;
  155.     }
  156.     public function setRegion(?Fraisdeliv $region): self
  157.     {
  158.         $this->region $region;
  159.         return $this;
  160.     }
  161.     public function getPhoto(): ?string
  162.     {
  163.         return $this->photo;
  164.     }
  165.     public function setPhoto(string $photo): self
  166.     {
  167.         $this->photo $photo;
  168.         return $this;
  169.     }
  170.     /**
  171.      * @return Collection<int, Devis>
  172.      */
  173.     public function getDevis(): Collection
  174.     {
  175.         return $this->devis;
  176.     }
  177.     public function addDevi(Devis $devi): self
  178.     {
  179.         if (!$this->devis->contains($devi)) {
  180.             $this->devis->add($devi);
  181.             $devi->setClient($this);
  182.         }
  183.         return $this;
  184.     }
  185.     public function removeDevi(Devis $devi): self
  186.     {
  187.         if ($this->devis->removeElement($devi)) {
  188.             // set the owning side to null (unless already changed)
  189.             if ($devi->getClient() === $this) {
  190.                 $devi->setClient(null);
  191.             }
  192.         }
  193.         return $this;
  194.     }
  195.     public function getFaxclient(): ?string
  196.     {
  197.         return $this->faxclient;
  198.     }
  199.     public function setFaxclient(?string $faxclient): self
  200.     {
  201.         $this->faxclient $faxclient;
  202.         return $this;
  203.     }
  204.     public function getMfclient(): ?string
  205.     {
  206.         return $this->mfclient;
  207.     }
  208.     public function setMfclient(?string $mfclient): self
  209.     {
  210.         $this->mfclient $mfclient;
  211.         return $this;
  212.     }
  213.     /**
  214.      * @return Collection<int, Gestionmachines>
  215.      */
  216.     public function getGestionmachines(): Collection
  217.     {
  218.         return $this->gestionmachines;
  219.     }
  220.     public function addGestionmachine(Gestionmachines $gestionmachine): self
  221.     {
  222.         if (!$this->gestionmachines->contains($gestionmachine)) {
  223.             $this->gestionmachines->add($gestionmachine);
  224.             $gestionmachine->setClient($this);
  225.         }
  226.         return $this;
  227.     }
  228.     public function removeGestionmachine(Gestionmachines $gestionmachine): self
  229.     {
  230.         if ($this->gestionmachines->removeElement($gestionmachine)) {
  231.             // set the owning side to null (unless already changed)
  232.             if ($gestionmachine->getClient() === $this) {
  233.                 $gestionmachine->setClient(null);
  234.             }
  235.         }
  236.         return $this;
  237.     }
  238.     public function getExoneres(): ?bool
  239.     {
  240.         return $this->exoneres;
  241.     }
  242.     public function isExoneres(): ?bool
  243.     {
  244.         return $this->exoneres;
  245.     }
  246.     public function setExoneres(?bool $exoneres): self
  247.     {
  248.         $this->exoneres $exoneres;
  249.         return $this;
  250.     }
  251.     /**
  252.      * @return Collection<int, Importdirect>
  253.      */
  254.     public function getImportdirects(): Collection
  255.     {
  256.         return $this->importdirects;
  257.     }
  258.     public function addImportdirect(Importdirect $importdirect): static
  259.     {
  260.         if (!$this->importdirects->contains($importdirect)) {
  261.             $this->importdirects->add($importdirect);
  262.             $importdirect->setClient($this);
  263.         }
  264.         return $this;
  265.     }
  266.     public function removeImportdirect(Importdirect $importdirect): static
  267.     {
  268.         if ($this->importdirects->removeElement($importdirect)) {
  269.             // set the owning side to null (unless already changed)
  270.             if ($importdirect->getClient() === $this) {
  271.                 $importdirect->setClient(null);
  272.             }
  273.         }
  274.         return $this;
  275.     }
  276.     /**
  277.      * @return Collection<int, Commissions>
  278.      */
  279.     public function getCommissions(): Collection
  280.     {
  281.         return $this->commissions;
  282.     }
  283.     public function addCommission(Commissions $commission): static
  284.     {
  285.         if (!$this->commissions->contains($commission)) {
  286.             $this->commissions->add($commission);
  287.             $commission->setClient($this);
  288.         }
  289.         return $this;
  290.     }
  291.     public function removeCommission(Commissions $commission): static
  292.     {
  293.         if ($this->commissions->removeElement($commission)) {
  294.             // set the owning side to null (unless already changed)
  295.             if ($commission->getClient() === $this) {
  296.                 $commission->setClient(null);
  297.             }
  298.         }
  299.         return $this;
  300.     }
  301.     /**
  302.      * @return Collection<int, Historiquedemandedevis>
  303.      */
  304.     public function getHistoriquedemandedevis(): Collection
  305.     {
  306.         return $this->historiquedemandedevis;
  307.     }
  308.     public function addHistoriquedemandedevi(Historiquedemandedevis $historiquedemandedevi): static
  309.     {
  310.         if (!$this->historiquedemandedevis->contains($historiquedemandedevi)) {
  311.             $this->historiquedemandedevis->add($historiquedemandedevi);
  312.             $historiquedemandedevi->setClient($this);
  313.         }
  314.         return $this;
  315.     }
  316.     public function removeHistoriquedemandedevi(Historiquedemandedevis $historiquedemandedevi): static
  317.     {
  318.         if ($this->historiquedemandedevis->removeElement($historiquedemandedevi)) {
  319.             // set the owning side to null (unless already changed)
  320.             if ($historiquedemandedevi->getClient() === $this) {
  321.                 $historiquedemandedevi->setClient(null);
  322.             }
  323.         }
  324.         return $this;
  325.     }
  326.     /**
  327.      * @return Collection<int, Historiqueintervention>
  328.      */
  329.     public function getHistoriqueinterventions(): Collection
  330.     {
  331.         return $this->historiqueinterventions;
  332.     }
  333.     public function addHistoriqueintervention(Historiqueintervention $historiqueintervention): static
  334.     {
  335.         if (!$this->historiqueinterventions->contains($historiqueintervention)) {
  336.             $this->historiqueinterventions->add($historiqueintervention);
  337.             $historiqueintervention->setClient($this);
  338.         }
  339.         return $this;
  340.     }
  341.     public function removeHistoriqueintervention(Historiqueintervention $historiqueintervention): static
  342.     {
  343.         if ($this->historiqueinterventions->removeElement($historiqueintervention)) {
  344.             // set the owning side to null (unless already changed)
  345.             if ($historiqueintervention->getClient() === $this) {
  346.                 $historiqueintervention->setClient(null);
  347.             }
  348.         }
  349.         return $this;
  350.     }
  351.     /**
  352.      * @return Collection<int, Bondesortie>
  353.      */
  354.     public function getBondesorties(): Collection
  355.     {
  356.         return $this->bondesorties;
  357.     }
  358.     public function addBondesorty(Bondesortie $bondesorty): self
  359.     {
  360.         if (!$this->bondesorties->contains($bondesorty)) {
  361.             $this->bondesorties->add($bondesorty);
  362.             $bondesorty->setClient($this);
  363.         }
  364.         return $this;
  365.     }
  366.     public function removeBondesorty(Bondesortie $bondesorty): self
  367.     {
  368.         if ($this->bondesorties->removeElement($bondesorty)) {
  369.             // set the owning side to null (unless already changed)
  370.             if ($bondesorty->getClient() === $this) {
  371.                 $bondesorty->setClient(null);
  372.             }
  373.         }
  374.         return $this;
  375.     }
  376. }