src/Entity/TrCategorie.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TrCategorieRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TrCategorieRepository::class)
  9.  */
  10. class TrCategorie
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $LIBELLE;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=TrProduits::class, mappedBy="CATEGORIE")
  24.      */
  25.     private $trProduits;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $Description;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=TrProduitsMasse::class, mappedBy="CATEGORIE")
  32.      */
  33.     private $trProduitsMasses;
  34.     public function __construct()
  35.     {
  36.         $this->trProduits = new ArrayCollection();
  37.         $this->trProduitsMasses = new ArrayCollection();
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getLIBELLE(): ?string
  44.     {
  45.         return $this->LIBELLE;
  46.     }
  47.     public function setLIBELLE(string $LIBELLE): self
  48.     {
  49.         $this->LIBELLE = $LIBELLE;
  50.         return $this;
  51.     }
  52.     /**
  53.      * @return Collection<int, TrProduits>
  54.      */
  55.     public function getTrProduits(): Collection
  56.     {
  57.         return $this->trProduits;
  58.     }
  59.     public function addTrProduit(TrProduits $trProduit): self
  60.     {
  61.         if (!$this->trProduits->contains($trProduit)) {
  62.             $this->trProduits[] = $trProduit;
  63.             $trProduit->setCATEGORIE($this);
  64.         }
  65.         return $this;
  66.     }
  67.     public function removeTrProduit(TrProduits $trProduit): self
  68.     {
  69.         if ($this->trProduits->removeElement($trProduit)) {
  70.             // set the owning side to null (unless already changed)
  71.             if ($trProduit->getCATEGORIE() === $this) {
  72.                 $trProduit->setCATEGORIE(null);
  73.             }
  74.         }
  75.         return $this;
  76.     }
  77.     public function getDescription(): ?string
  78.     {
  79.         return $this->Description;
  80.     }
  81.     public function setDescription(?string $Description): self
  82.     {
  83.         $this->Description = $Description;
  84.         return $this;
  85.     }
  86.     
  87.     public function __toString()
  88.     {
  89.         return $this->LIBELLE;
  90.     }
  91.     /**
  92.      * @return Collection<int, TrProduitsMasse>
  93.      */
  94.     public function getTrProduitsMasses(): Collection
  95.     {
  96.         return $this->trProduitsMasses;
  97.     }
  98.     public function addTrProduitsMass(TrProduitsMasse $trProduitsMass): self
  99.     {
  100.         if (!$this->trProduitsMasses->contains($trProduitsMass)) {
  101.             $this->trProduitsMasses[] = $trProduitsMass;
  102.             $trProduitsMass->setCATEGORIE($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeTrProduitsMass(TrProduitsMasse $trProduitsMass): self
  107.     {
  108.         if ($this->trProduitsMasses->removeElement($trProduitsMass)) {
  109.             // set the owning side to null (unless already changed)
  110.             if ($trProduitsMass->getCATEGORIE() === $this) {
  111.                 $trProduitsMass->setCATEGORIE(null);
  112.             }
  113.         }
  114.         return $this;
  115.     }
  116. }