diff options
Diffstat (limited to 'src/model/entities/Page.php')
| -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 | { |
