<?phpnamespace App\Entity\Page;use App\Entity\Page\Page;use App\Repository\Page\PageTypeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PageTypeRepository::class)]class PageType{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $slug = null; #[ORM\Column(length: 255)] private ?string $label = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $description = null; #[ORM\Column(nullable: true)] private ?bool $isSystem = null; #[ORM\OneToMany(mappedBy: 'pageType', targetEntity: Page::class)] private Collection $pages; public function __toString() { return $this->label; } public function __construct() { $this->pages = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): static { $this->slug = $slug; return $this; } public function getLabel(): ?string { return $this->label; } public function setLabel(string $label): static { $this->label = $label; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): static { $this->description = $description; return $this; } public function isIsSystem(): ?bool { return $this->isSystem; } public function setIsSystem(?bool $isSystem): static { $this->isSystem = $isSystem; return $this; } /** * @return Collection<int, Page> */ public function getPages(): Collection { return $this->pages; } public function addPage(Page $page): static { if (!$this->pages->contains($page)) { $this->pages->add($page); $page->setPageType($this); } return $this; } public function removePage(Page $page): static { if ($this->pages->removeElement($page)) { // set the owning side to null (unless already changed) if ($page->getPageType() === $this) { $page->setPageType(null); } } return $this; }}