<?phpnamespace App\Entity;use App\Repository\ThemeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=ThemeRepository::class) */class Theme{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $label; /** * @ORM\OneToMany(targetEntity=Tag::class, mappedBy="theme") */ private $tags; /** * @ORM\Column(type="string", length=255) */ private $idYouscribeTheme; /** * @ORM\OneToMany(targetEntity=Produit::class, mappedBy="theme") */ private $produits; public function __construct() { $this->tags = new ArrayCollection(); $this->produits = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getLabel(): ?string { return $this->label; } public function setLabel(?string $label): self { $this->label = $label; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } /** * @return Collection|Tag[] */ public function getTags(): Collection { return $this->tags; } public function addTag(Tag $tag): self { if (!$this->tags->contains($tag)) { $this->tags[] = $tag; $tag->setTheme($this); } return $this; } public function removeTag(Tag $tag): self { if ($this->tags->removeElement($tag)) { // set the owning side to null (unless already changed) if ($tag->getTheme() === $this) { $tag->setTheme(null); } } return $this; } public function getIdYouscribeTheme(): ?string { return $this->idYouscribeTheme; } public function setIdYouscribeTheme(string $idYouscribeTheme): self { $this->idYouscribeTheme = $idYouscribeTheme; return $this; } /** * @return Collection|Produit[] */ public function getProduits(): Collection { return $this->produits; } public function addProduit(Produit $produit): self { if (!$this->produits->contains($produit)) { $this->produits[] = $produit; $produit->setTheme($this); } return $this; } public function removeProduit(Produit $produit): self { if ($this->produits->removeElement($produit)) { // set the owning side to null (unless already changed) if ($produit->getTheme() === $this) { $produit->setTheme(null); } } return $this; }}