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\ORM\Mapping as ORM;
  7. use App\Annotation\CustomAnnotation;
  8. /**
  9.  * @ORM\Entity(repositoryClass=FournisseurRepository::class)
  10.  */
  11. class Fournisseur
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255, nullable=true)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\Column(type="text", nullable=true)
  25.      */
  26.     private $siren;
  27.     /**
  28.      * @ORM\Column(type="text", nullable=true)
  29.      */
  30.     private $siret;
  31.     /**
  32.      * @ORM\Column(type="text", nullable=true)
  33.      */
  34.     private $adresse;
  35.     /**
  36.      * @ORM\Column(type="text", nullable=true)
  37.      */
  38.     private $city;
  39.     /**
  40.      * @ORM\Column(type="text", nullable=true)
  41.      */
  42.     private $codePostal;
  43.     /**
  44.      * @ORM\Column(type="text", nullable=true)
  45.      */
  46.     private $country;
  47.     /**
  48.      * @ORM\Column(type="text", nullable=true)
  49.      */
  50.     private $countryCode;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      */
  54.     private $email;
  55.     /**
  56.      * @ORM\Column(type="text", nullable=true)
  57.      */
  58.     private $tel;
  59.     /**
  60.      * @ORM\Column(type="boolean", nullable=true)
  61.      */
  62.     private $isEnabled;
  63.     /**
  64.      * @ORM\OneToMany(targetEntity="Rib",mappedBy="fournisseur", cascade={"persist"})
  65.      */
  66.     private $rib;
  67.     /**
  68.      * @ORM\Column(type="text", nullable=true)
  69.      */
  70.     private $note;
  71.     /**
  72.      * @ORM\Column(type="boolean", nullable=true)
  73.      */
  74.     private $isArchived;
  75.     /**
  76.      * @ORM\OneToMany(targetEntity="User", cascade={"persist"},mappedBy="fournisseur",)
  77.      */
  78.     private $user;
  79.     /**
  80.      * @ORM\Column(type="boolean", nullable=true)
  81.      */
  82.     private $isErpAccee;
  83.     /**
  84.      * @ORM\Column(type="text", nullable=true)
  85.      */
  86.     private $codeFournisseur;
  87.     /**
  88.      * @ORM\Column(type="text", nullable=true)
  89.      */
  90.     private $tel2;
  91.     /**
  92.      * @ORM\Column(type="text", nullable=true)
  93.      */
  94.     private $telecopie;
  95.     /**
  96.      * @ORM\Column(type="text", nullable=true)
  97.      */
  98.     private $typeTiers;
  99.     /**
  100.      * @ORM\Column(type="text", nullable=true)
  101.      */
  102.     private $rcsRm;
  103.     /**
  104.      * @ORM\Column(type="text", nullable=true)
  105.      * @CustomAnnotation("Code blocage")
  106.      */
  107.     private $codeBlocage;
  108.     /**
  109.      * @ORM\Column(type="text", nullable=true)
  110.      */
  111.     private $tvaIntracommunautaire;
  112.     /**
  113.      * @ORM\Column(type="text", nullable=true)
  114.      */
  115.     private $complementSiret;
  116.     /**
  117.      * @ORM\Column(type="text", nullable=true)
  118.      */
  119.     private $codeNaf;
  120.     /**
  121.      * @ORM\Column(type="text", nullable=true)
  122.      */
  123.     private $complementIdenetification;
  124.     /**
  125.      * @ORM\Column(type="text", nullable=true)
  126.      */
  127.     private $formuleJuridique;
  128.     /**
  129.      * @ORM\Column(type="text", nullable=true)
  130.      */
  131.     private $rueVoie;
  132.     /**
  133.      * @ORM\Column(type="text", nullable=true)
  134.      */
  135.     private $complementAdresse;
  136.     /**
  137.      * @ORM\Column(type="text", nullable=true)
  138.      */
  139.     private $boitePostaleCommune;
  140.     /**
  141.      * @ORM\Column(type="text", nullable=true)
  142.      */
  143.     private $devise;
  144.     /**
  145.      * @ORM\Column(type="boolean", nullable=true)
  146.      */
  147.     private $isFlux;
  148.     /**
  149.      * @ORM\Column(type="text", nullable=true)
  150.      */
  151.     private $codeModeReglt;
  152.     /**
  153.      * @ORM\Column(type="text", nullable=true)
  154.      */
  155.     private $reverseFactoring;
  156.     /**
  157.      * @ORM\Column(type="text", nullable=true)
  158.      */
  159.     private $tvaDebit;
  160.     /**
  161.      * @ORM\OneToMany(targetEntity="App\Entity\FournisseurProject",mappedBy="fournisseur", cascade={"persist"})
  162.      */
  163.     private $fournisseurProject;
  164.     /**
  165.      * @ORM\Column(type="boolean", nullable=true)
  166.      */
  167.     private $isNotaire;
  168.     /**
  169.      * @ORM\Column(type="text", nullable=true)
  170.      */
  171.     private $nameComplementaire;
  172.     public function __construct()
  173.     {
  174.         $this->rib = new ArrayCollection();
  175.         $this->fournisseurProject = new ArrayCollection();
  176.         $this->user = new ArrayCollection();
  177.     }
  178.     public function getId(): ?int
  179.     {
  180.         return $this->id;
  181.     }
  182.     public function getName(): ?string
  183.     {
  184.         return $this->name;
  185.     }
  186.     public function setName(?string $name): self
  187.     {
  188.         $this->name = $name;
  189.         return $this;
  190.     }
  191.     public function getSiren(): ?string
  192.     {
  193.         return $this->siren;
  194.     }
  195.     public function setSiren(?string $siren): self
  196.     {
  197.         $this->siren = $siren;
  198.         return $this;
  199.     }
  200.     public function getSiret(): ?string
  201.     {
  202.         return $this->siret;
  203.     }
  204.     public function setSiret(?string $siret): self
  205.     {
  206.         $this->siret = $siret;
  207.         return $this;
  208.     }
  209.     public function getAdresse(): ?string
  210.     {
  211.         return $this->adresse;
  212.     }
  213.     public function setAdresse(?string $adresse): self
  214.     {
  215.         $this->adresse = $adresse;
  216.         return $this;
  217.     }
  218.     public function getEmail(): ?string
  219.     {
  220.         return $this->email;
  221.     }
  222.     public function setEmail(?string $email): self
  223.     {
  224.         $this->email = $email;
  225.         return $this;
  226.     }
  227.     public function getTel(): ?string
  228.     {
  229.         return $this->tel;
  230.     }
  231.     public function setTel(?string $tel): self
  232.     {
  233.         $this->tel = $tel;
  234.         return $this;
  235.     }
  236.     public function getIsEnabled(): ?bool
  237.     {
  238.         return $this->isEnabled;
  239.     }
  240.     public function setIsEnabled(?bool $isEnabled): self
  241.     {
  242.         $this->isEnabled = $isEnabled;
  243.         return $this;
  244.     }
  245.     public function getNote(): ?string
  246.     {
  247.         return $this->note;
  248.     }
  249.     public function setNote(?string $note): self
  250.     {
  251.         $this->note = $note;
  252.         return $this;
  253.     }
  254.     /**
  255.      * @return Collection|Rib[]
  256.      */
  257.     public function getRib(): Collection
  258.     {
  259.         return $this->rib;
  260.     }
  261.     public function addRib(Rib $rib): self
  262.     {
  263.         if (!$this->rib->contains($rib)) {
  264.             $this->rib[] = $rib;
  265.             $rib->setFournisseur($this);
  266.         }
  267.         return $this;
  268.     }
  269.     public function removeRib(Rib $rib): self
  270.     {
  271.         if ($this->rib->removeElement($rib)) {
  272.             // set the owning side to null (unless already changed)
  273.             if ($rib->getFournisseur() === $this) {
  274.                 $rib->setFournisseur(null);
  275.             }
  276.         }
  277.         return $this;
  278.     }
  279.     public function getCity(): ?string
  280.     {
  281.         return $this->city;
  282.     }
  283.     public function setCity(?string $city): self
  284.     {
  285.         $this->city = $city;
  286.         return $this;
  287.     }
  288.     public function getCodePostal(): ?string
  289.     {
  290.         return $this->codePostal;
  291.     }
  292.     public function setCodePostal(?string $codePostal): self
  293.     {
  294.         $this->codePostal = $codePostal;
  295.         return $this;
  296.     }
  297.     public function getCountry(): ?string
  298.     {
  299.         return $this->country;
  300.     }
  301.     public function setCountry(?string $country): self
  302.     {
  303.         $this->country = $country;
  304.         return $this;
  305.     }
  306.     public function getCountryCode(): ?string
  307.     {
  308.         return $this->countryCode;
  309.     }
  310.     public function setCountryCode(?string $countryCode): self
  311.     {
  312.         $this->countryCode = $countryCode;
  313.         return $this;
  314.     }
  315.     public function getIsArchived(): ?bool
  316.     {
  317.         return $this->isArchived;
  318.     }
  319.     public function setIsArchived(?bool $isArchived): self
  320.     {
  321.         $this->isArchived = $isArchived;
  322.         return $this;
  323.     }
  324.     
  325.     public function getIsErpAccee(): ?bool
  326.     {
  327.         return $this->isErpAccee;
  328.     }
  329.     public function setIsErpAccee(?bool $isErpAccee): self
  330.     {
  331.         $this->isErpAccee = $isErpAccee;
  332.         return $this;
  333.     }
  334.     public function getCodeFournisseur(): ?string
  335.     {
  336.         return $this->codeFournisseur;
  337.     }
  338.     public function setCodeFournisseur(?string $codeFournisseur): self
  339.     {
  340.         $this->codeFournisseur = $codeFournisseur;
  341.         return $this;
  342.     }
  343.     public function getTel2(): ?string
  344.     {
  345.         return $this->tel2;
  346.     }
  347.     public function setTel2(?string $tel2): self
  348.     {
  349.         $this->tel2 = $tel2;
  350.         return $this;
  351.     }
  352.     public function getTelecopie(): ?string
  353.     {
  354.         return $this->telecopie;
  355.     }
  356.     public function setTelecopie(?string $telecopie): self
  357.     {
  358.         $this->telecopie = $telecopie;
  359.         return $this;
  360.     }
  361.     public function getTypeTiers(): ?string
  362.     {
  363.         return $this->typeTiers;
  364.     }
  365.     public function setTypeTiers(?string $typeTiers): self
  366.     {
  367.         $this->typeTiers = $typeTiers;
  368.         return $this;
  369.     }
  370.     public function getRcsRm(): ?string
  371.     {
  372.         return $this->rcsRm;
  373.     }
  374.     public function setRcsRm(?string $rcsRm): self
  375.     {
  376.         $this->rcsRm = $rcsRm;
  377.         return $this;
  378.     }
  379.     public function getCodeBlocage(): ?string
  380.     {
  381.         return $this->codeBlocage;
  382.     }
  383.     public function getCodeBlocageStr()
  384.     {
  385.         if($this->codeBlocage == 'N' ){
  386.             return 'Non';
  387.         }else{
  388.             return 'Oui';
  389.         }
  390.     }
  391.     public function setCodeBlocage(?string $codeBlocage): self
  392.     {
  393.         $this->codeBlocage = $codeBlocage;
  394.         return $this;
  395.     }
  396.     public function getTvaIntracommunautaire(): ?string
  397.     {
  398.         return $this->tvaIntracommunautaire;
  399.     }
  400.     public function setTvaIntracommunautaire(?string $tvaIntracommunautaire): self
  401.     {
  402.         $this->tvaIntracommunautaire = $tvaIntracommunautaire;
  403.         return $this;
  404.     }
  405.     public function getComplementSiret(): ?string
  406.     {
  407.         return $this->complementSiret;
  408.     }
  409.     public function setComplementSiret(?string $complementSiret): self
  410.     {
  411.         $this->complementSiret = $complementSiret;
  412.         return $this;
  413.     }
  414.     public function getCodeNaf(): ?string
  415.     {
  416.         return $this->codeNaf;
  417.     }
  418.     public function setCodeNaf(?string $codeNaf): self
  419.     {
  420.         $this->codeNaf = $codeNaf;
  421.         return $this;
  422.     }
  423.     public function getComplementIdenetification(): ?string
  424.     {
  425.         return $this->complementIdenetification;
  426.     }
  427.     public function setComplementIdenetification(?string $complementIdenetification): self
  428.     {
  429.         $this->complementIdenetification = $complementIdenetification;
  430.         return $this;
  431.     }
  432.     public function getFormuleJuridique(): ?string
  433.     {
  434.         return $this->formuleJuridique;
  435.     }
  436.     public function setFormuleJuridique(?string $formuleJuridique): self
  437.     {
  438.         $this->formuleJuridique = $formuleJuridique;
  439.         return $this;
  440.     }
  441.     public function getRueVoie(): ?string
  442.     {
  443.         return $this->rueVoie;
  444.     }
  445.     public function setRueVoie(?string $rueVoie): self
  446.     {
  447.         $this->rueVoie = $rueVoie;
  448.         return $this;
  449.     }
  450.     public function getComplementAdresse(): ?string
  451.     {
  452.         return $this->complementAdresse;
  453.     }
  454.     public function setComplementAdresse(?string $complementAdresse): self
  455.     {
  456.         $this->complementAdresse = $complementAdresse;
  457.         return $this;
  458.     }
  459.     public function getBoitePostaleCommune(): ?string
  460.     {
  461.         return $this->boitePostaleCommune;
  462.     }
  463.     public function setBoitePostaleCommune(?string $boitePostaleCommune): self
  464.     {
  465.         $this->boitePostaleCommune = $boitePostaleCommune;
  466.         return $this;
  467.     }
  468.     public function getDevise(): ?string
  469.     {
  470.         return $this->devise;
  471.     }
  472.     public function setDevise(?string $devise): self
  473.     {
  474.         $this->devise = $devise;
  475.         return $this;
  476.     }
  477.     public function getIsFlux(): ?bool
  478.     {
  479.         return $this->isFlux;
  480.     }
  481.     public function setIsFlux(?bool $isFlux): self
  482.     {
  483.         $this->isFlux = $isFlux;
  484.         return $this;
  485.     }
  486.     /**
  487.      * @return Collection|FournisseurProject[]
  488.      */
  489.     public function getFournisseurProject(): Collection
  490.     {
  491.         return $this->fournisseurProject;
  492.     }
  493.     public function addFournisseurProject(FournisseurProject $fournisseurProject): self
  494.     {
  495.         if (!$this->fournisseurProject->contains($fournisseurProject)) {
  496.             $this->fournisseurProject[] = $fournisseurProject;
  497.             $fournisseurProject->setFournisseur($this);
  498.         }
  499.         return $this;
  500.     }
  501.     public function getCodeModeReglt(): ?string
  502.     {
  503.         return $this->codeModeReglt;
  504.     }
  505.     public function setCodeModeReglt(?string $codeModeReglt): self
  506.     {
  507.         $this->codeModeReglt = $codeModeReglt;
  508.         return $this;
  509.     }
  510.     public function getReverseFactoring(): ?string
  511.     {
  512.         return $this->reverseFactoring;
  513.     }
  514.     public function setReverseFactoring(?string $reverseFactoring): self
  515.     {
  516.         $this->reverseFactoring = $reverseFactoring;
  517.         return $this;
  518.     }
  519.     public function getTvaDebit(): ?string
  520.     {
  521.         return $this->tvaDebit;
  522.     }
  523.     public function setTvaDebit(?string $tvaDebit): self
  524.     {
  525.         $this->tvaDebit = $tvaDebit;
  526.         return $this;
  527.     }
  528.     public function removeFournisseurProject(FournisseurProject $fournisseurProject): self
  529.     {
  530.         if ($this->fournisseurProject->removeElement($fournisseurProject)) {
  531.             // set the owning side to null (unless already changed)
  532.             if ($fournisseurProject->getFournisseur() === $this) {
  533.                 $fournisseurProject->setFournisseur(null);
  534.             }
  535.         }
  536.         return $this;
  537.     }
  538.     public function getIsNotaire(): ?bool
  539.     {
  540.         return $this->isNotaire;
  541.     }
  542.     public function setIsNotaire(?bool $isNotaire): self
  543.     {
  544.         $this->isNotaire = $isNotaire;
  545.         return $this;
  546.     }
  547.     public function getNameComplementaire(): ?string
  548.     {
  549.         return $this->nameComplementaire;
  550.     }
  551.     public function setNameComplementaire(?string $nameComplementaire): self
  552.     {
  553.         $this->nameComplementaire = $nameComplementaire;
  554.         return $this;
  555.     }
  556.     public function __toString()
  557.     {
  558.         return $this->name;
  559.     }
  560.     public function addUser(User $user): self
  561.     {
  562.         if (!$this->user->contains($user)) {
  563.             $this->user[] = $user;
  564.             $user->setFournisseur($this);
  565.         }
  566.         return $this;
  567.     }
  568.     public function removeUser(User $user): self
  569.     {
  570.         if ($this->user->removeElement($user)) {
  571.             // set the owning side to null (unless already changed)
  572.             if ($user->getFournisseur() === $this) {
  573.                 $user->setFournisseur(null);
  574.             }
  575.         }
  576.         return $this;
  577.     }
  578.     /**
  579.      * @return Collection|User[]
  580.      */
  581.     public function getUser(): Collection
  582.     {
  583.         return $this->user;
  584.     }
  585. }