diff options
author | polo <ordipolo@gmx.fr> | 2025-04-27 23:58:46 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2025-04-27 23:58:46 +0200 |
commit | 962d315ec0c99974df3dc2261bf94c54ca8cdbdd (patch) | |
tree | 7463f74a722e759067daf8c3ef43202a60352759 /src/model/entities | |
parent | a3ba7dde60dc1c94b7170ec28266a966e5004d33 (diff) | |
download | cms-962d315ec0c99974df3dc2261bf94c54ca8cdbdd.zip |
page menu et chemins, partie3
Diffstat (limited to 'src/model/entities')
-rw-r--r-- | src/model/entities/Page.php | 16 |
1 files changed, 16 insertions, 0 deletions
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 | |||
75 | { | 75 | { |
76 | return $this->page_path; | 76 | return $this->page_path; |
77 | } | 77 | } |
78 | public function setPagePath(string $path):void | ||
79 | { | ||
80 | $this->page_path = $path; | ||
81 | } | ||
78 | public function getEndOfPath(): string | 82 | public function getEndOfPath(): string |
79 | { | 83 | { |
80 | return $this->end_of_path; | 84 | return $this->end_of_path; |
@@ -107,6 +111,10 @@ class Page | |||
107 | { | 111 | { |
108 | return $this->parent; | 112 | return $this->parent; |
109 | } | 113 | } |
114 | public function setParent(?Page $parent): void | ||
115 | { | ||
116 | $this->parent = $parent; | ||
117 | } | ||
110 | public function getChildren(): Collection | 118 | public function getChildren(): Collection |
111 | { | 119 | { |
112 | return $this->children; | 120 | return $this->children; |
@@ -125,6 +133,14 @@ class Page | |||
125 | $this->children[] = $child; | 133 | $this->children[] = $child; |
126 | $this->sortChildren(false); | 134 | $this->sortChildren(false); |
127 | } | 135 | } |
136 | public function removeChild(self $child): void | ||
137 | { | ||
138 | foreach($this->children as $index => $candidate){ | ||
139 | if($candidate === $child){ | ||
140 | unset($this->children[$index]); | ||
141 | } | ||
142 | } | ||
143 | } | ||
128 | 144 | ||
129 | public function findPageById(int $id): ?Page | 145 | public function findPageById(int $id): ?Page |
130 | { | 146 | { |