From 962d315ec0c99974df3dc2261bf94c54ca8cdbdd Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 27 Apr 2025 23:58:46 +0200 Subject: page menu et chemins, partie3 --- src/model/entities/Page.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/model/entities/Page.php') diff --git a/src/model/entities/Page.php b/src/model/entities/Page.php index e3e60ca..aaff1ff 100644 --- a/src/model/entities/Page.php +++ b/src/model/entities/Page.php @@ -75,6 +75,10 @@ class Page { return $this->page_path; } + public function setPagePath(string $path):void + { + $this->page_path = $path; + } public function getEndOfPath(): string { return $this->end_of_path; @@ -107,6 +111,10 @@ class Page { return $this->parent; } + public function setParent(?Page $parent): void + { + $this->parent = $parent; + } public function getChildren(): Collection { return $this->children; @@ -125,6 +133,14 @@ class Page $this->children[] = $child; $this->sortChildren(false); } + public function removeChild(self $child): void + { + foreach($this->children as $index => $candidate){ + if($candidate === $child){ + unset($this->children[$index]); + } + } + } public function findPageById(int $id): ?Page { -- cgit v1.2.3