src/Entity/Fournisseur.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FournisseurRepository;
  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. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. #[ORM\Entity(repositoryClassFournisseurRepository::class)]
  10. #[UniqueEntity(fields: ['email'], message'Il existe déjà un compte avec cet email')]
  11. class Fournisseur
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255uniquetrue)]
  18.     private ?string $email null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $nom null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $prenom null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $tel null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $raisonsocial null;
  27.     #[ORM\OneToMany(mappedBy'fournisseur'targetEntityFicheoffre::class, cascade: ["remove"])]
  28.     private Collection $ficheoffres;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $devise null;
  31.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  32.     private ?string $adresse null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $fax null;
  35.     #[ORM\OneToMany(mappedBy'fournisseur'targetEntityAiguilles::class, cascade: ["remove"])]
  36.     private Collection $aiguilles;
  37.     #[ORM\OneToMany(mappedBy'fournisseur'targetEntityPlatines::class, cascade: ["remove"])]
  38.     private Collection $platines;
  39.     #[ORM\OneToMany(mappedBy'fournisseur'targetEntityCourroie::class, cascade: ["remove"])]
  40.     private Collection $courroie;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $mf null;
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $rc null;
  45.     #[ORM\OneToMany(mappedBy'fournisseur'targetEntityFamillesdarticles::class, cascade: ["remove"])]
  46.     private Collection $famillesdarticles;
  47.     #[ORM\OneToMany(mappedBy'fournisseur'targetEntityArchivearticle::class, cascade: ["remove"])]
  48.     private Collection $archivearticles;
  49.     #[ORM\OneToMany(mappedBy'fournisseur'targetEntityImportdirect::class, cascade: ["remove"])]
  50.     private Collection $importdirects;
  51.     #[ORM\ManyToMany(targetEntityBanque::class, inversedBy'fournisseurs')]
  52.     private Collection $banque;
  53.     #[ORM\OneToMany(mappedBy'fournisseur'targetEntityDevis::class)]
  54.     private Collection $devis;
  55.     #[ORM\OneToMany(mappedBy'fournisseur'targetEntityFicheachatnf::class)]
  56.     private Collection $ficheachatnfs;
  57.     public function __construct()
  58.     {
  59.         $this->ficheoffres = new ArrayCollection();
  60.         $this->aiguilles = new ArrayCollection();
  61.         $this->platines = new ArrayCollection();
  62.         $this->courroie = new ArrayCollection();
  63.         $this->famillesdarticles = new ArrayCollection();
  64.         $this->archivearticles = new ArrayCollection();
  65.         $this->importdirects = new ArrayCollection();
  66.         $this->banque = new ArrayCollection();
  67.         $this->devis = new ArrayCollection();
  68.         $this->ficheachatnfs = new ArrayCollection();
  69.     }
  70.     public function getId(): ?int
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getEmail(): ?string
  75.     {
  76.         return $this->email;
  77.     }
  78.     public function setEmail(string $email): self
  79.     {
  80.         $this->email $email;
  81.         return $this;
  82.     }
  83.     public function getNom(): ?string
  84.     {
  85.         return $this->nom;
  86.     }
  87.     public function setNom(string $nom): self
  88.     {
  89.         $this->nom $nom;
  90.         return $this;
  91.     }
  92.     public function getPrenom(): ?string
  93.     {
  94.         return $this->prenom;
  95.     }
  96.     public function setPrenom(string $prenom): self
  97.     {
  98.         $this->prenom $prenom;
  99.         return $this;
  100.     }
  101.     public function getTel(): ?string
  102.     {
  103.         return $this->tel;
  104.     }
  105.     public function setTel(string $tel): self
  106.     {
  107.         $this->tel $tel;
  108.         return $this;
  109.     }
  110.     public function getRaisonsocial(): ?string
  111.     {
  112.         return $this->raisonsocial;
  113.     }
  114.     public function setRaisonsocial(string $raisonsocial): self
  115.     {
  116.         $this->raisonsocial $raisonsocial;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Collection<int, Ficheoffre>
  121.      */
  122.     public function getFicheoffres(): Collection
  123.     {
  124.         return $this->ficheoffres;
  125.     }
  126.     public function getDevise(): ?string
  127.     {
  128.         return $this->devise;
  129.     }
  130.     public function setDevise(?string $devise): self
  131.     {
  132.         $this->devise $devise;
  133.         return $this;
  134.     }
  135.     public function getAdresse(): ?string
  136.     {
  137.         return $this->adresse;
  138.     }
  139.     public function setAdresse(?string $adresse): self
  140.     {
  141.         $this->adresse $adresse;
  142.         return $this;
  143.     }
  144.     public function getFax(): ?string
  145.     {
  146.         return $this->fax;
  147.     }
  148.     public function setFax(?string $fax): self
  149.     {
  150.         $this->fax $fax;
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return Collection<int, Aiguilles>
  155.      */
  156.     public function getAiguilles(): Collection
  157.     {
  158.         return $this->aiguilles;
  159.     }
  160.     public function addAiguille(Aiguilles $aiguille): self
  161.     {
  162.         if (!$this->aiguilles->contains($aiguille)) {
  163.             $this->aiguilles->add($aiguille);
  164.             $aiguille->setFournisseur($this);
  165.         }
  166.         return $this;
  167.     }
  168.     public function removeAiguille(Aiguilles $aiguille): self
  169.     {
  170.         if ($this->aiguilles->removeElement($aiguille)) {
  171.             // set the owning side to null (unless already changed)
  172.             if ($aiguille->getFournisseur() === $this) {
  173.                 $aiguille->setFournisseur(null);
  174.             }
  175.         }
  176.         return $this;
  177.     }
  178.     /**
  179.      * @return Collection<int, Platines>
  180.      */
  181.     public function getPlatines(): Collection
  182.     {
  183.         return $this->platines;
  184.     }
  185.     public function addPlatine(Platines $platine): self
  186.     {
  187.         if (!$this->platines->contains($platine)) {
  188.             $this->platines->add($platine);
  189.             $platine->setFournisseur($this);
  190.         }
  191.         return $this;
  192.     }
  193.     public function removePlatine(Platines $platine): self
  194.     {
  195.         if ($this->platines->removeElement($platine)) {
  196.             // set the owning side to null (unless already changed)
  197.             if ($platine->getFournisseur() === $this) {
  198.                 $platine->setFournisseur(null);
  199.             }
  200.         }
  201.         return $this;
  202.     }
  203.     /**
  204.      * @return Collection<int, Courroie>
  205.      */
  206.     public function getCourroie(): Collection
  207.     {
  208.         return $this->courroie;
  209.     }
  210.     public function addCourroie(Courroie $courroie): self
  211.     {
  212.         if (!$this->courroie->contains($courroie)) {
  213.             $this->courroie->add($courroie);
  214.             $courroie->setFournisseur($this);
  215.         }
  216.         return $this;
  217.     }
  218.     public function removeCourroie(Courroie $courroie): self
  219.     {
  220.         if ($this->courroie->removeElement($courroie)) {
  221.             // set the owning side to null (unless already changed)
  222.             if ($courroie->getFournisseur() === $this) {
  223.                 $courroie->setFournisseur(null);
  224.             }
  225.         }
  226.         return $this;
  227.     }
  228.     public function getMf(): ?string
  229.     {
  230.         return $this->mf;
  231.     }
  232.     public function setMf(?string $mf): self
  233.     {
  234.         $this->mf $mf;
  235.         return $this;
  236.     }
  237.     public function getRc(): ?string
  238.     {
  239.         return $this->rc;
  240.     }
  241.     public function setRc(?string $rc): self
  242.     {
  243.         $this->rc $rc;
  244.         return $this;
  245.     }
  246.     /**
  247.      * @return Collection<int, Famillesdarticles>
  248.      */
  249.     public function getFamillesdarticles(): Collection
  250.     {
  251.         return $this->famillesdarticles;
  252.     }
  253.     public function addFamillesdarticle(Famillesdarticles $famillesdarticle): self
  254.     {
  255.         if (!$this->famillesdarticles->contains($famillesdarticle)) {
  256.             $this->famillesdarticles->add($famillesdarticle);
  257.             $famillesdarticle->setFournisseur($this);
  258.         }
  259.         return $this;
  260.     }
  261.     public function removeFamillesdarticle(Famillesdarticles $famillesdarticle): self
  262.     {
  263.         if ($this->famillesdarticles->removeElement($famillesdarticle)) {
  264.             // set the owning side to null (unless already changed)
  265.             if ($famillesdarticle->getFournisseur() === $this) {
  266.                 $famillesdarticle->setFournisseur(null);
  267.             }
  268.         }
  269.         return $this;
  270.     }
  271.     /**
  272.      * @return Collection<int, Archivearticle>
  273.      */
  274.     public function getArchivearticles(): Collection
  275.     {
  276.         return $this->archivearticles;
  277.     }
  278.     public function addArchivearticle(Archivearticle $archivearticle): static
  279.     {
  280.         if (!$this->archivearticles->contains($archivearticle)) {
  281.             $this->archivearticles->add($archivearticle);
  282.             $archivearticle->setFournisseur($this);
  283.         }
  284.         return $this;
  285.     }
  286.     public function removeArchivearticle(Archivearticle $archivearticle): static
  287.     {
  288.         if ($this->archivearticles->removeElement($archivearticle)) {
  289.             // set the owning side to null (unless already changed)
  290.             if ($archivearticle->getFournisseur() === $this) {
  291.                 $archivearticle->setFournisseur(null);
  292.             }
  293.         }
  294.         return $this;
  295.     }
  296.     /**
  297.      * @return Collection<int, Importdirect>
  298.      */
  299.     public function getImportdirects(): Collection
  300.     {
  301.         return $this->importdirects;
  302.     }
  303.     public function addImportdirect(Importdirect $importdirect): static
  304.     {
  305.         if (!$this->importdirects->contains($importdirect)) {
  306.             $this->importdirects->add($importdirect);
  307.             $importdirect->setFournisseur($this);
  308.         }
  309.         return $this;
  310.     }
  311.     public function removeImportdirect(Importdirect $importdirect): static
  312.     {
  313.         if ($this->importdirects->removeElement($importdirect)) {
  314.             // set the owning side to null (unless already changed)
  315.             if ($importdirect->getFournisseur() === $this) {
  316.                 $importdirect->setFournisseur(null);
  317.             }
  318.         }
  319.         return $this;
  320.     }
  321.     /**
  322.      * @return Collection<int, Banque>
  323.      */
  324.     public function getBanque(): Collection
  325.     {
  326.         return $this->banque;
  327.     }
  328.     public function addBanque(Banque $banque): static
  329.     {
  330.         if (!$this->banque->contains($banque)) {
  331.             $this->banque->add($banque);
  332.         }
  333.         return $this;
  334.     }
  335.     public function removeBanque(Banque $banque): static
  336.     {
  337.         $this->banque->removeElement($banque);
  338.         return $this;
  339.     }
  340.     /**
  341.      * @return Collection<int, Devis>
  342.      */
  343.     public function getDevis(): Collection
  344.     {
  345.         return $this->devis;
  346.     }
  347.     public function addDevi(Devis $devi): static
  348.     {
  349.         if (!$this->devis->contains($devi)) {
  350.             $this->devis->add($devi);
  351.             $devi->setFournisseur($this);
  352.         }
  353.         return $this;
  354.     }
  355.     public function removeDevi(Devis $devi): static
  356.     {
  357.         if ($this->devis->removeElement($devi)) {
  358.             // set the owning side to null (unless already changed)
  359.             if ($devi->getFournisseur() === $this) {
  360.                 $devi->setFournisseur(null);
  361.             }
  362.         }
  363.         return $this;
  364.     }
  365.     /**
  366.      * @return Collection<int, Ficheachatnf>
  367.      */
  368.     public function getFicheachatnfs(): Collection
  369.     {
  370.         return $this->ficheachatnfs;
  371.     }
  372.     public function addFicheachatnf(Ficheachatnf $ficheachatnf): self
  373.     {
  374.         if (!$this->ficheachatnfs->contains($ficheachatnf)) {
  375.             $this->ficheachatnfs->add($ficheachatnf);
  376.             $ficheachatnf->setFournisseur($this);
  377.         }
  378.         return $this;
  379.     }
  380.     public function removeFicheachatnf(Ficheachatnf $ficheachatnf): self
  381.     {
  382.         if ($this->ficheachatnfs->removeElement($ficheachatnf)) {
  383.             // set the owning side to null (unless already changed)
  384.             if ($ficheachatnf->getFournisseur() === $this) {
  385.                 $ficheachatnf->setFournisseur(null);
  386.             }
  387.         }
  388.         return $this;
  389.     }
  390. }