src/Entity/Produit.php line 15

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProduitRepository;
  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. #[ORM\Entity(repositoryClassProduitRepository::class)]
  9. #[ORM\Index(columns: ['cip'], name'cip_idx')]
  10. #[ORM\Index(columns: ['reference'], name'reference_idx')]
  11. class Produit
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column]
  18.     private ?int $cip null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $reference null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $description1 null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $description2 null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $description3 null;
  27.     #[ORM\Column(length255)]
  28.     private ?string $description4 null;
  29.     #[ORM\Column(length255)]
  30.     private ?string $description5 null;
  31.     #[ORM\Column(length255)]
  32.     private ?string $description6 null;
  33.     #[ORM\OneToMany(mappedBy'produit'targetEntityCommande400::class)]
  34.     private Collection $commande400s;
  35.     #[ORM\OneToMany(mappedBy'produit'targetEntityLignecommande::class)]
  36.     private Collection $lignecommandes;
  37.     #[ORM\ManyToOne(inversedBy'produits')]
  38.     private ?Marque $marque null;
  39.     #[ORM\OneToMany(mappedBy'produit'targetEntityTarif::class)]
  40.     private Collection $tarifs;
  41.     #[ORM\OneToMany(mappedBy'cip'targetEntityTarifLivre::class)]
  42.     private Collection $tariflivres;
  43.     #[ORM\ManyToOne(inversedBy'produits')]
  44.     private ?TypeProduit $type null;
  45.     #[ORM\Column(typeTypes::SMALLINT)]
  46.     private ?int $actif 1;
  47.     #[ORM\OneToMany(mappedBy'code_produit'targetEntityReferencesArticlesAtlantic::class)]
  48.     private Collection $referencesArticlesAtlantics;
  49.     public function __construct()
  50.     {
  51.         $this->commande400s = new ArrayCollection();
  52.         $this->lignecommandes = new ArrayCollection();
  53.         $this->tarifs = new ArrayCollection();
  54.         $this->tariflivres = new ArrayCollection();
  55.         $this->referencesArticlesAtlantics = new ArrayCollection();
  56.     }
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getCip(): ?int
  62.     {
  63.         return $this->cip;
  64.     }
  65.     public function setCip(int $cip): self
  66.     {
  67.         $this->cip $cip;
  68.         return $this;
  69.     }
  70.     public function getReference(): ?string
  71.     {
  72.         return $this->reference;
  73.     }
  74.     public function setReference(string $reference): self
  75.     {
  76.         $this->reference $reference;
  77.         return $this;
  78.     }
  79.     public function getDescription1(): ?string
  80.     {
  81.         return $this->description1;
  82.     }
  83.     public function setDescription1(string $description1): self
  84.     {
  85.         $this->description1 $description1;
  86.         return $this;
  87.     }
  88.     public function getDescription2(): ?string
  89.     {
  90.         return $this->description2;
  91.     }
  92.     public function setDescription2(string $description2): self
  93.     {
  94.         $this->description2 $description2;
  95.         return $this;
  96.     }
  97.     public function getDescription3(): ?string
  98.     {
  99.         return $this->description3;
  100.     }
  101.     public function setDescription3(string $description3): self
  102.     {
  103.         $this->description3 $description3;
  104.         return $this;
  105.     }
  106.     public function getDescription4(): ?string
  107.     {
  108.         return $this->description4;
  109.     }
  110.     public function setDescription4(string $description4): self
  111.     {
  112.         $this->description4 $description4;
  113.         return $this;
  114.     }
  115.     public function getDescription5(): ?string
  116.     {
  117.         return $this->description5;
  118.     }
  119.     public function setDescription5(string $description5): self
  120.     {
  121.         $this->description5 $description5;
  122.         return $this;
  123.     }
  124.     public function getDescription6(): ?string
  125.     {
  126.         return $this->description6;
  127.     }
  128.     public function setDescription6(string $description6): self
  129.     {
  130.         $this->description6 $description6;
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return Collection<int, Commande400>
  135.      */
  136.     public function getCommande400s(): Collection
  137.     {
  138.         return $this->commande400s;
  139.     }
  140.     public function addCommande400(Commande400 $commande400): self
  141.     {
  142.         if (!$this->commande400s->contains($commande400)) {
  143.             $this->commande400s->add($commande400);
  144.             $commande400->setProduit($this);
  145.         }
  146.         return $this;
  147.     }
  148.     public function removeCommande400(Commande400 $commande400): self
  149.     {
  150.         if ($this->commande400s->removeElement($commande400)) {
  151.             // set the owning side to null (unless already changed)
  152.             if ($commande400->getProduit() === $this) {
  153.                 $commande400->setProduit(null);
  154.             }
  155.         }
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return Collection<int, Lignecommande>
  160.      */
  161.     public function getLignecommandes(): Collection
  162.     {
  163.         return $this->lignecommandes;
  164.     }
  165.     public function addLignecommande(Lignecommande $lignecommande): self
  166.     {
  167.         if (!$this->lignecommandes->contains($lignecommande)) {
  168.             $this->lignecommandes->add($lignecommande);
  169.             $lignecommande->setProduit($this);
  170.         }
  171.         return $this;
  172.     }
  173.     public function removeLignecommande(Lignecommande $lignecommande): self
  174.     {
  175.         if ($this->lignecommandes->removeElement($lignecommande)) {
  176.             // set the owning side to null (unless already changed)
  177.             if ($lignecommande->getProduit() === $this) {
  178.                 $lignecommande->setProduit(null);
  179.             }
  180.         }
  181.         return $this;
  182.     }
  183.     public function getMarque(): ?Marque
  184.     {
  185.         return $this->marque;
  186.     }
  187.     public function setMarque(?Marque $marque): self
  188.     {
  189.         $this->marque $marque;
  190.         return $this;
  191.     }
  192.     /**
  193.      * @return Collection<int, Tarif>
  194.      */
  195.     public function getTarifs(): Collection
  196.     {
  197.         return $this->tarifs;
  198.     }
  199.     public function addTarif(Tarif $tarif): self
  200.     {
  201.         if (!$this->tarifs->contains($tarif)) {
  202.             $this->tarifs->add($tarif);
  203.             $tarif->setProduit($this);
  204.         }
  205.         return $this;
  206.     }
  207.     public function removeTarif(Tarif $tarif): self
  208.     {
  209.         if ($this->tarifs->removeElement($tarif)) {
  210.             // set the owning side to null (unless already changed)
  211.             if ($tarif->getProduit() === $this) {
  212.                 $tarif->setProduit(null);
  213.             }
  214.         }
  215.         return $this;
  216.     }
  217.     /**
  218.      * @return Collection<int, TarifLivre>
  219.      */
  220.     public function getTariflivres(): Collection
  221.     {
  222.         return $this->tariflivres;
  223.     }
  224.     public function addTariflivre(TarifLivre $tariflivre): self
  225.     {
  226.         if (!$this->tariflivres->contains($tariflivre)) {
  227.             $this->tariflivres->add($tariflivre);
  228.             $tariflivre->setCip($this);
  229.         }
  230.         return $this;
  231.     }
  232.     public function removeTariflivre(TarifLivre $tariflivre): self
  233.     {
  234.         if ($this->tariflivres->removeElement($tariflivre)) {
  235.             // set the owning side to null (unless already changed)
  236.             if ($tariflivre->getCip() === $this) {
  237.                 $tariflivre->setCip(null);
  238.             }
  239.         }
  240.         return $this;
  241.     }
  242.     public function getType(): ?TypeProduit
  243.     {
  244.         return $this->type;
  245.     }
  246.     public function setType(?TypeProduit $type): self
  247.     {
  248.         $this->type $type;
  249.         return $this;
  250.     }
  251.     public function getActif(): ?int
  252.     {
  253.         return $this->actif;
  254.     }
  255.     public function setActif(int $actif): self
  256.     {
  257.         $this->actif $actif;
  258.         return $this;
  259.     }
  260.     /**
  261.      * @return Collection<int, ReferencesArticlesAtlantic>
  262.      */
  263.     public function getReferencesArticlesAtlantics(): Collection
  264.     {
  265.         return $this->referencesArticlesAtlantics;
  266.     }
  267.     public function addReferencesArticlesAtlantic(ReferencesArticlesAtlantic $referencesArticlesAtlantic): self
  268.     {
  269.         if (!$this->referencesArticlesAtlantics->contains($referencesArticlesAtlantic)) {
  270.             $this->referencesArticlesAtlantics->add($referencesArticlesAtlantic);
  271.             $referencesArticlesAtlantic->setCodeProduit($this);
  272.         }
  273.         return $this;
  274.     }
  275.     public function removeReferencesArticlesAtlantic(ReferencesArticlesAtlantic $referencesArticlesAtlantic): self
  276.     {
  277.         if ($this->referencesArticlesAtlantics->removeElement($referencesArticlesAtlantic)) {
  278.             // set the owning side to null (unless already changed)
  279.             if ($referencesArticlesAtlantic->getCodeProduit() === $this) {
  280.                 $referencesArticlesAtlantic->setCodeProduit(null);
  281.             }
  282.         }
  283.         return $this;
  284.     }
  285. }