src/Entity/Products.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\ProductsRepository")
  8.  */
  9. class Products
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\Column(type="string", length=255,nullable=true)
  23.      */
  24.     private $description;
  25.     /**
  26.      * @ORM\OneToMany(targetEntity="App\Entity\MatPremiere", mappedBy="products")
  27.      */
  28.     private $matPremieres;
  29.     /**
  30.      * @ORM\OneToMany(targetEntity="App\Entity\AdminDonneurOrdre", mappedBy="filiere")
  31.      */
  32.     private $adminDonneurOrdres;
  33.     /**
  34.      * @ORM\OneToMany(targetEntity="App\Entity\Transaction", mappedBy="filiere")
  35.      */
  36.     private $transactions;
  37.     /**
  38.      * @ORM\OneToMany(targetEntity="App\Entity\LetterOfIntentToPurchase", mappedBy="filiere")
  39.      */
  40.     private $letterOfIntentToPurchases;
  41.     /**
  42.      * @ORM\OneToMany(targetEntity="App\Entity\AdminDonneurOrdre", mappedBy="filiere1")
  43.      */
  44.     private $adminDonneurOrdreFiliere1;
  45.     /**
  46.      * @ORM\OneToMany(targetEntity="App\Entity\AdminDonneurOrdre", mappedBy="filiere2")
  47.      */
  48.     private $adminDonneurOrdreFiliere2;
  49.     /**
  50.      * @ORM\OneToMany(targetEntity="App\Entity\AppelDeMarge", mappedBy="filiere")
  51.      */
  52.     private $appelDeMarges;
  53.     /**
  54.      * @ORM\OneToMany(targetEntity="App\Entity\SousJacent", mappedBy="filiere")
  55.      */
  56.     private $sousJacents;
  57.     /**
  58.      * @ORM\OneToMany(targetEntity="App\Entity\Operation", mappedBy="filiere")
  59.      */
  60.     private $operations;
  61.     /**
  62.      * @ORM\OneToMany(targetEntity="App\Entity\Quotation", mappedBy="produit")
  63.      */
  64.     private $quotations;
  65.     /**
  66.      * @ORM\OneToMany(targetEntity="App\Entity\TraitementDsDemdDachat", mappedBy="produit")
  67.      */
  68.     private $traitementDsDemdDachats;
  69.     /**
  70.      * @ORM\OneToMany(targetEntity="App\Entity\DemandeDeCotation", mappedBy="product")
  71.      */
  72.     private $demandeDeCotations;
  73.     /**
  74.      * @ORM\OneToMany(targetEntity="App\Entity\Prospect", mappedBy="produit")
  75.      */
  76.     private $prospects;
  77.     public function __construct()
  78.     {
  79.         $this->matPremieres = new ArrayCollection();
  80.         $this->adminDonneurOrdres = new ArrayCollection();
  81.         $this->transactions = new ArrayCollection();
  82.         $this->letterOfIntentToPurchases = new ArrayCollection();
  83.         $this->adminDonneurOrdreFiliere1 = new ArrayCollection();
  84.         $this->adminDonneurOrdreFiliere2 = new ArrayCollection();
  85.         $this->appelDeMarges = new ArrayCollection();
  86.         $this->sousJacents = new ArrayCollection();
  87.         $this->operations = new ArrayCollection();
  88.         $this->quotations = new ArrayCollection();
  89.         $this->traitementDsDemdDachats = new ArrayCollection();
  90.         $this->demandeDeCotations = new ArrayCollection();
  91.         $this->prospects = new ArrayCollection();
  92.     }
  93.     public function getId(): ?int
  94.     {
  95.         return $this->id;
  96.     }
  97.     public function getName(): ?string
  98.     {
  99.         return $this->name;
  100.     }
  101.     public function setName(string $name): self
  102.     {
  103.         $this->name $name;
  104.         return $this;
  105.     }
  106.     public function getDescription(): ?string
  107.     {
  108.         return $this->description;
  109.     }
  110.     public function setDescription(?string $description):string
  111.     {
  112.         $this->description $description;
  113.         return $this;
  114.     }
  115.     /**
  116.      * @return Collection|MatPremiere[]
  117.      */
  118.     public function getMatPremieres(): Collection
  119.     {
  120.         return $this->matPremieres;
  121.     }
  122.     public function addMatPremiere(MatPremiere $matPremiere): self
  123.     {
  124.         if (!$this->matPremieres->contains($matPremiere)) {
  125.             $this->matPremieres[] = $matPremiere;
  126.             $matPremiere->setProducts($this);
  127.         }
  128.         return $this;
  129.     }
  130.     public function removeMatPremiere(MatPremiere $matPremiere): self
  131.     {
  132.         if ($this->matPremieres->contains($matPremiere)) {
  133.             $this->matPremieres->removeElement($matPremiere);
  134.             // set the owning side to null (unless already changed)
  135.             if ($matPremiere->getProducts() === $this) {
  136.                 $matPremiere->setProducts(null);
  137.             }
  138.         }
  139.         return $this;
  140.     }
  141.     public function __toString()
  142.     {
  143.         return $this->name;
  144.     }
  145.     /**
  146.      * @return Collection|AdminDonneurOrdre[]
  147.      */
  148.     public function getAdminDonneurOrdres(): Collection
  149.     {
  150.         return $this->adminDonneurOrdres;
  151.     }
  152.     public function addAdminDonneurOrdre(AdminDonneurOrdre $adminDonneurOrdre): self
  153.     {
  154.         if (!$this->adminDonneurOrdres->contains($adminDonneurOrdre)) {
  155.             $this->adminDonneurOrdres[] = $adminDonneurOrdre;
  156.             $adminDonneurOrdre->setFiliere($this);
  157.         }
  158.         return $this;
  159.     }
  160.     public function removeAdminDonneurOrdre(AdminDonneurOrdre $adminDonneurOrdre): self
  161.     {
  162.         if ($this->adminDonneurOrdres->contains($adminDonneurOrdre)) {
  163.             $this->adminDonneurOrdres->removeElement($adminDonneurOrdre);
  164.             // set the owning side to null (unless already changed)
  165.             if ($adminDonneurOrdre->getFiliere() === $this) {
  166.                 $adminDonneurOrdre->setFiliere(null);
  167.             }
  168.         }
  169.         return $this;
  170.     }
  171.     /**
  172.      * @return Collection|Transaction[]
  173.      */
  174.     public function getTransactions(): Collection
  175.     {
  176.         return $this->transactions;
  177.     }
  178.     public function addTransaction(Transaction $transaction): self
  179.     {
  180.         if (!$this->transactions->contains($transaction)) {
  181.             $this->transactions[] = $transaction;
  182.             $transaction->setFiliere($this);
  183.         }
  184.         return $this;
  185.     }
  186.     public function removeTransaction(Transaction $transaction): self
  187.     {
  188.         if ($this->transactions->contains($transaction)) {
  189.             $this->transactions->removeElement($transaction);
  190.             // set the owning side to null (unless already changed)
  191.             if ($transaction->getFiliere() === $this) {
  192.                 $transaction->setFiliere(null);
  193.             }
  194.         }
  195.         return $this;
  196.     }
  197.     /**
  198.      * @return Collection|LetterOfIntentToPurchase[]
  199.      */
  200.     public function getLetterOfIntentToPurchases(): Collection
  201.     {
  202.         return $this->letterOfIntentToPurchases;
  203.     }
  204.     public function addLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
  205.     {
  206.         if (!$this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
  207.             $this->letterOfIntentToPurchases[] = $letterOfIntentToPurchase;
  208.             $letterOfIntentToPurchase->setFiliere($this);
  209.         }
  210.         return $this;
  211.     }
  212.     public function removeLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
  213.     {
  214.         if ($this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
  215.             $this->letterOfIntentToPurchases->removeElement($letterOfIntentToPurchase);
  216.             // set the owning side to null (unless already changed)
  217.             if ($letterOfIntentToPurchase->getFiliere() === $this) {
  218.                 $letterOfIntentToPurchase->setFiliere(null);
  219.             }
  220.         }
  221.         return $this;
  222.     }
  223.     /**
  224.      * @return Collection|AdminDonneurOrdre[]
  225.      */
  226.     public function getAdminDonneurOrdreFiliere1(): Collection
  227.     {
  228.         return $this->adminDonneurOrdreFiliere1;
  229.     }
  230.     public function addAdminDonneurOrdreFiliere1(AdminDonneurOrdre $adminDonneurOrdreFiliere1): self
  231.     {
  232.         if (!$this->adminDonneurOrdreFiliere1->contains($adminDonneurOrdreFiliere1)) {
  233.             $this->adminDonneurOrdreFiliere1[] = $adminDonneurOrdreFiliere1;
  234.             $adminDonneurOrdreFiliere1->setFiliere1($this);
  235.         }
  236.         return $this;
  237.     }
  238.     public function removeAdminDonneurOrdreFiliere1(AdminDonneurOrdre $adminDonneurOrdreFiliere1): self
  239.     {
  240.         if ($this->adminDonneurOrdreFiliere1->contains($adminDonneurOrdreFiliere1)) {
  241.             $this->adminDonneurOrdreFiliere1->removeElement($adminDonneurOrdreFiliere1);
  242.             // set the owning side to null (unless already changed)
  243.             if ($adminDonneurOrdreFiliere1->getFiliere1() === $this) {
  244.                 $adminDonneurOrdreFiliere1->setFiliere1(null);
  245.             }
  246.         }
  247.         return $this;
  248.     }
  249.     /**
  250.      * @return Collection|AdminDonneurOrdre[]
  251.      */
  252.     public function getAdminDonneurOrdreFiliere2(): Collection
  253.     {
  254.         return $this->adminDonneurOrdreFiliere2;
  255.     }
  256.     public function addAdminDonneurOrdreFiliere2(AdminDonneurOrdre $adminDonneurOrdreFiliere2): self
  257.     {
  258.         if (!$this->adminDonneurOrdreFiliere2->contains($adminDonneurOrdreFiliere2)) {
  259.             $this->adminDonneurOrdreFiliere2[] = $adminDonneurOrdreFiliere2;
  260.             $adminDonneurOrdreFiliere2->setFiliere2($this);
  261.         }
  262.         return $this;
  263.     }
  264.     public function removeAdminDonneurOrdreFiliere2(AdminDonneurOrdre $adminDonneurOrdreFiliere2): self
  265.     {
  266.         if ($this->adminDonneurOrdreFiliere2->contains($adminDonneurOrdreFiliere2)) {
  267.             $this->adminDonneurOrdreFiliere2->removeElement($adminDonneurOrdreFiliere2);
  268.             // set the owning side to null (unless already changed)
  269.             if ($adminDonneurOrdreFiliere2->getFiliere2() === $this) {
  270.                 $adminDonneurOrdreFiliere2->setFiliere2(null);
  271.             }
  272.         }
  273.         return $this;
  274.     }
  275.     /**
  276.      * @return Collection|AppelDeMarge[]
  277.      */
  278.     public function getAppelDeMarges(): Collection
  279.     {
  280.         return $this->appelDeMarges;
  281.     }
  282.     public function addAppelDeMarge(AppelDeMarge $appelDeMarge): self
  283.     {
  284.         if (!$this->appelDeMarges->contains($appelDeMarge)) {
  285.             $this->appelDeMarges[] = $appelDeMarge;
  286.             $appelDeMarge->setFiliere($this);
  287.         }
  288.         return $this;
  289.     }
  290.     public function removeAppelDeMarge(AppelDeMarge $appelDeMarge): self
  291.     {
  292.         if ($this->appelDeMarges->contains($appelDeMarge)) {
  293.             $this->appelDeMarges->removeElement($appelDeMarge);
  294.             // set the owning side to null (unless already changed)
  295.             if ($appelDeMarge->getFiliere() === $this) {
  296.                 $appelDeMarge->setFiliere(null);
  297.             }
  298.         }
  299.         return $this;
  300.     }
  301.     /**
  302.      * @return Collection|SousJacent[]
  303.      */
  304.     public function getSousJacents(): Collection
  305.     {
  306.         return $this->sousJacents;
  307.     }
  308.     public function addSousJacent(SousJacent $sousJacent): self
  309.     {
  310.         if (!$this->sousJacents->contains($sousJacent)) {
  311.             $this->sousJacents[] = $sousJacent;
  312.             $sousJacent->setFiliere($this);
  313.         }
  314.         return $this;
  315.     }
  316.     public function removeSousJacent(SousJacent $sousJacent): self
  317.     {
  318.         if ($this->sousJacents->contains($sousJacent)) {
  319.             $this->sousJacents->removeElement($sousJacent);
  320.             // set the owning side to null (unless already changed)
  321.             if ($sousJacent->getFiliere() === $this) {
  322.                 $sousJacent->setFiliere(null);
  323.             }
  324.         }
  325.         return $this;
  326.     }
  327.     /**
  328.      * @return Collection|Operation[]
  329.      */
  330.     public function getOperations(): Collection
  331.     {
  332.         return $this->operations;
  333.     }
  334.     public function addOperation(Operation $operation): self
  335.     {
  336.         if (!$this->operations->contains($operation)) {
  337.             $this->operations[] = $operation;
  338.             $operation->setFiliere($this);
  339.         }
  340.         return $this;
  341.     }
  342.     public function removeOperation(Operation $operation): self
  343.     {
  344.         if ($this->operations->contains($operation)) {
  345.             $this->operations->removeElement($operation);
  346.             // set the owning side to null (unless already changed)
  347.             if ($operation->getFiliere() === $this) {
  348.                 $operation->setFiliere(null);
  349.             }
  350.         }
  351.         return $this;
  352.     }
  353.     /**
  354.      * @return Collection|Quotation[]
  355.      */
  356.     public function getQuotations(): Collection
  357.     {
  358.         return $this->quotations;
  359.     }
  360.     public function addQuotation(Quotation $quotation): self
  361.     {
  362.         if (!$this->quotations->contains($quotation)) {
  363.             $this->quotations[] = $quotation;
  364.             $quotation->setProduit($this);
  365.         }
  366.         return $this;
  367.     }
  368.     public function removeQuotation(Quotation $quotation): self
  369.     {
  370.         if ($this->quotations->contains($quotation)) {
  371.             $this->quotations->removeElement($quotation);
  372.             // set the owning side to null (unless already changed)
  373.             if ($quotation->getProduit() === $this) {
  374.                 $quotation->setProduit(null);
  375.             }
  376.         }
  377.         return $this;
  378.     }
  379.     /**
  380.      * @return Collection|TraitementDsDemdDachat[]
  381.      */
  382.     public function getTraitementDsDemdDachats(): Collection
  383.     {
  384.         return $this->traitementDsDemdDachats;
  385.     }
  386.     public function addTraitementDsDemdDachat(TraitementDsDemdDachat $traitementDsDemdDachat): self
  387.     {
  388.         if (!$this->traitementDsDemdDachats->contains($traitementDsDemdDachat)) {
  389.             $this->traitementDsDemdDachats[] = $traitementDsDemdDachat;
  390.             $traitementDsDemdDachat->setProduit($this);
  391.         }
  392.         return $this;
  393.     }
  394.     public function removeTraitementDsDemdDachat(TraitementDsDemdDachat $traitementDsDemdDachat): self
  395.     {
  396.         if ($this->traitementDsDemdDachats->contains($traitementDsDemdDachat)) {
  397.             $this->traitementDsDemdDachats->removeElement($traitementDsDemdDachat);
  398.             // set the owning side to null (unless already changed)
  399.             if ($traitementDsDemdDachat->getProduit() === $this) {
  400.                 $traitementDsDemdDachat->setProduit(null);
  401.             }
  402.         }
  403.         return $this;
  404.     }
  405.     /**
  406.      * @return Collection|DemandeDeCotation[]
  407.      */
  408.     public function getDemandeDeCotations(): Collection
  409.     {
  410.         return $this->demandeDeCotations;
  411.     }
  412.     public function addDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
  413.     {
  414.         if (!$this->demandeDeCotations->contains($demandeDeCotation)) {
  415.             $this->demandeDeCotations[] = $demandeDeCotation;
  416.             $demandeDeCotation->setProduct($this);
  417.         }
  418.         return $this;
  419.     }
  420.     public function removeDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
  421.     {
  422.         if ($this->demandeDeCotations->contains($demandeDeCotation)) {
  423.             $this->demandeDeCotations->removeElement($demandeDeCotation);
  424.             // set the owning side to null (unless already changed)
  425.             if ($demandeDeCotation->getProduct() === $this) {
  426.                 $demandeDeCotation->setProduct(null);
  427.             }
  428.         }
  429.         return $this;
  430.     }
  431.     /**
  432.      * @return Collection|Prospect[]
  433.      */
  434.     public function getProspects(): Collection
  435.     {
  436.         return $this->prospects;
  437.     }
  438.     public function addProspect(Prospect $prospect): self
  439.     {
  440.         if (!$this->prospects->contains($prospect)) {
  441.             $this->prospects[] = $prospect;
  442.             $prospect->setProduit($this);
  443.         }
  444.         return $this;
  445.     }
  446.     public function removeProspect(Prospect $prospect): self
  447.     {
  448.         if ($this->prospects->contains($prospect)) {
  449.             $this->prospects->removeElement($prospect);
  450.             // set the owning side to null (unless already changed)
  451.             if ($prospect->getProduit() === $this) {
  452.                 $prospect->setProduit(null);
  453.             }
  454.         }
  455.         return $this;
  456.     }
  457. }