src/Entity/Rubrique.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RubriqueRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=RubriqueRepository::class)
  9.  */
  10. class Rubrique
  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, nullable=true)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $description;
  26.     /**
  27.      * @ORM\Column(type="integer", nullable=true)
  28.      */
  29.     private $OrderID;
  30.     /**
  31.      * @ORM\Column(type="integer", nullable=true , options={"default" : 0})
  32.      */
  33.     private $typeRub;
  34.     /**
  35.      * @ORM\ManyToMany(targetEntity=Projet::class, inversedBy="rubriques")
  36.      */
  37.     private $projet;
  38.     /**
  39.      * @ORM\ManyToMany(targetEntity=Produit::class, mappedBy="rubrique")
  40.      */
  41.     private $produits;
  42.     /**
  43.      * @ORM\Column(type="integer", nullable=true)
  44.      */
  45.     private $visibility;
  46.     /**
  47.      * @ORM\OneToMany(targetEntity=ClientProduit::class, mappedBy="rubrique")
  48.      */
  49.     private $clientProduits;
  50.     public function __construct()
  51.     {
  52.         $this->projet = new ArrayCollection();
  53.         $this->produits = new ArrayCollection();
  54.         $this->clientProduits = new ArrayCollection();
  55.     }
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getName(): ?string
  61.     {
  62.         return $this->name;
  63.     }
  64.     public function setName(?string $name): self
  65.     {
  66.         $this->name $name;
  67.         return $this;
  68.     }
  69.     public function getDescription(): ?string
  70.     {
  71.         return $this->description;
  72.     }
  73.     public function setDescription(?string $description): self
  74.     {
  75.         $this->description $description;
  76.         return $this;
  77.     }
  78.     public function getOrderID(): ?int
  79.     {
  80.         return $this->OrderID;
  81.     }
  82.     public function setOrderID(?int $OrderID): self
  83.     {
  84.         $this->OrderID $OrderID;
  85.         return $this;
  86.     }
  87.     public function getTypeRub(): ?int
  88.     {
  89.         return $this->typeRub;
  90.     }
  91.     public function setTypeRub(?int $type): self
  92.     {
  93.         $this->typeRub $type;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection|Projet[]
  98.      */
  99.     public function getProjet(): Collection
  100.     {
  101.         return $this->projet;
  102.     }
  103.     public function addProjet(Projet $projet): self
  104.     {
  105.         if (!$this->projet->contains($projet)) {
  106.             $this->projet[] = $projet;
  107.         }
  108.         return $this;
  109.     }
  110.     public function removeProjet(Projet $projet): self
  111.     {
  112.         $this->projet->removeElement($projet);
  113.         return $this;
  114.     }
  115.     /**
  116.      * @return Collection|Produit[]
  117.      */
  118.     public function getProduits(): Collection
  119.     {
  120.         return $this->produits;
  121.     }
  122.     public function addProduit(Produit $produit): self
  123.     {
  124.         if (!$this->produits->contains($produit)) {
  125.             $this->produits[] = $produit;
  126.             $produit->addRubrique($this);
  127.         }
  128.         return $this;
  129.     }
  130.     public function removeProduit(Produit $produit): self
  131.     {
  132.         if ($this->produits->removeElement($produit)) {
  133.             $produit->removeRubrique($this);
  134.         }
  135.         return $this;
  136.     }
  137.     public function getVisibility(): ?int
  138.     {
  139.         return $this->visibility;
  140.     }
  141.     public function setVisibility(?int $visibility): self
  142.     {
  143.         $this->visibility $visibility;
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return Collection|ClientProduit[]
  148.      */
  149.     public function getClientProduits(): Collection
  150.     {
  151.         return $this->clientProduits;
  152.     }
  153.     public function addClientProduit(ClientProduit $clientProduit): self
  154.     {
  155.         if (!$this->clientProduits->contains($clientProduit)) {
  156.             $this->clientProduits[] = $clientProduit;
  157.             $clientProduit->setRubrique($this);
  158.         }
  159.         return $this;
  160.     }
  161.     public function removeClientProduit(ClientProduit $clientProduit): self
  162.     {
  163.         if ($this->clientProduits->removeElement($clientProduit)) {
  164.             // set the owning side to null (unless already changed)
  165.             if ($clientProduit->getRubrique() === $this) {
  166.                 $clientProduit->setRubrique(null);
  167.             }
  168.         }
  169.         return $this;
  170.     }
  171. }