<?phpnamespace App\Entity;use App\Repository\SousThematiqueRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=SousThematiqueRepository::class) */class SousThematique{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column */ private ?int $id = null; /** * @ORM\Column(length=255, unique=true) */ private ?string $name = null; /** * @ORM\Column(length=255, unique=true) */ private ?string $slug = null; public function getSlug(): ?string { return $this->slug; } public function setSlug(?string $slug): void { $this->slug = $slug; } /** * @ORM\ManyToMany(targetEntity=Thematique::class, mappedBy="sousThematique") */ private Collection $thematiques; /** * @ORM\ManyToMany(targetEntity=Blog::class, mappedBy="sous_thematique") */ private Collection $blogs; public function __construct() { $this->thematiques = new ArrayCollection(); $this->blogs = 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; } /** * @return Collection<int, Thematique> */ public function getThematiques(): Collection { return $this->thematiques; } public function addThematique(Thematique $thematique): self { if (!$this->thematiques->contains($thematique)) { $this->thematiques->add($thematique); $thematique->addSousThematique($this); } return $this; } public function removeThematique(Thematique $thematique): self { if ($this->thematiques->removeElement($thematique)) { $thematique->removeSousThematique($this); } return $this; } /** * @return Collection<int, Blog> */ public function getBlogs(): Collection { return $this->blogs; } public function addBlog(Blog $blog): self { if (!$this->blogs->contains($blog)) { $this->blogs->add($blog); $blog->addSousThematique($this); } return $this; } public function removeBlog(Blog $blog): self { if ($this->blogs->removeElement($blog)) { $blog->removeSousThematique($this); } return $this; }}