src/Entity/Theme.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ThemeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ThemeRepository::class)
  9.  */
  10. class Theme
  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 $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $label;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=Tag::class, mappedBy="theme")
  28.      */
  29.     private $tags;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $idYouscribeTheme;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=Produit::class, mappedBy="theme")
  36.      */
  37.     private $produits;
  38.     public function __construct()
  39.     {
  40.         $this->tags = new ArrayCollection();
  41.         $this->produits = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getName(): ?string
  48.     {
  49.         return $this->name;
  50.     }
  51.     public function setName(string $name): self
  52.     {
  53.         $this->name $name;
  54.         return $this;
  55.     }
  56.     public function getLabel(): ?string
  57.     {
  58.         return $this->label;
  59.     }
  60.     public function setLabel(?string $label): self
  61.     {
  62.         $this->label $label;
  63.         return $this;
  64.     }
  65.     public function getDescription(): ?string
  66.     {
  67.         return $this->description;
  68.     }
  69.     public function setDescription(?string $description): self
  70.     {
  71.         $this->description $description;
  72.         return $this;
  73.     }
  74.     /**
  75.      * @return Collection|Tag[]
  76.      */
  77.     public function getTags(): Collection
  78.     {
  79.         return $this->tags;
  80.     }
  81.     public function addTag(Tag $tag): self
  82.     {
  83.         if (!$this->tags->contains($tag)) {
  84.             $this->tags[] = $tag;
  85.             $tag->setTheme($this);
  86.         }
  87.         return $this;
  88.     }
  89.     public function removeTag(Tag $tag): self
  90.     {
  91.         if ($this->tags->removeElement($tag)) {
  92.             // set the owning side to null (unless already changed)
  93.             if ($tag->getTheme() === $this) {
  94.                 $tag->setTheme(null);
  95.             }
  96.         }
  97.         return $this;
  98.     }
  99.     public function getIdYouscribeTheme(): ?string
  100.     {
  101.         return $this->idYouscribeTheme;
  102.     }
  103.     public function setIdYouscribeTheme(string $idYouscribeTheme): self
  104.     {
  105.         $this->idYouscribeTheme $idYouscribeTheme;
  106.         return $this;
  107.     }
  108.     /**
  109.      * @return Collection|Produit[]
  110.      */
  111.     public function getProduits(): Collection
  112.     {
  113.         return $this->produits;
  114.     }
  115.     public function addProduit(Produit $produit): self
  116.     {
  117.         if (!$this->produits->contains($produit)) {
  118.             $this->produits[] = $produit;
  119.             $produit->setTheme($this);
  120.         }
  121.         return $this;
  122.     }
  123.     public function removeProduit(Produit $produit): self
  124.     {
  125.         if ($this->produits->removeElement($produit)) {
  126.             // set the owning side to null (unless already changed)
  127.             if ($produit->getTheme() === $this) {
  128.                 $produit->setTheme(null);
  129.             }
  130.         }
  131.         return $this;
  132.     }
  133. }