<?phpnamespace App\Entity;use App\Repository\ForumCategoryRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=ForumCategoryRepository::class) */class ForumCategory{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255, nullable=true) */ private ?string $name; /** * @ORM\Column(type="string", length=255, nullable=true) */ private ?string $country; /** * @ORM\Column(type="string", length=25, nullable=true) */ private ?string $countryMin; /** * @ORM\OneToMany(targetEntity=ForumTopic::class, mappedBy="category") */ private $topics; public function __construct() { $this->topics = 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, ForumTopic> */ public function getTopics(): Collection { return $this->topics; } public function addTopic(ForumTopic $topic): self { if (!$this->topics->contains($topic)) { $this->topics[] = $topic; $topic->setCategory($this); } return $this; } public function removeTopic(ForumTopic $topic): self { if ($this->topics->removeElement($topic)) { // set the owning side to null (unless already changed) if ($topic->getCategory() === $this) { $topic->setCategory(null); } } return $this; } public function getCountry(): ?string { return $this->country; } public function setCountry(?string $country): self { $this->country = $country; return $this; } public function getCountryMin(): ?string { return $this->countryMin; } public function setCountryMin(?string $countryMin): self { $this->countryMin = $countryMin; return $this; }}