diff options
author | polo <ordipolo@gmx.fr> | 2025-05-07 01:11:27 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2025-05-07 01:11:27 +0200 |
commit | 2d8ec75f4aaf3b93fd9f6758f8dcb4f1f9f03d0c (patch) | |
tree | dfa6f5e31ed96f9ddcf9238304364e7887c26a7d /src/model/entities | |
parent | 5fc1a655e0271b583f3caa009524ea9d99a8bd3e (diff) | |
download | cms-2d8ec75f4aaf3b93fd9f6758f8dcb4f1f9f03d0c.zip |
page menu et chemins, partie5
Diffstat (limited to 'src/model/entities')
-rw-r--r-- | src/model/entities/Page.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/model/entities/Page.php b/src/model/entities/Page.php index aaff1ff..9564342 100644 --- a/src/model/entities/Page.php +++ b/src/model/entities/Page.php | |||
@@ -135,11 +135,9 @@ class Page | |||
135 | } | 135 | } |
136 | public function removeChild(self $child): void | 136 | public function removeChild(self $child): void |
137 | { | 137 | { |
138 | foreach($this->children as $index => $candidate){ | 138 | $this->children->removeElement($child); |
139 | if($candidate === $child){ | 139 | $this->children = new ArrayCollection(array_values($this->children->toArray())); // réindexer en passant par un tableau |
140 | unset($this->children[$index]); | 140 | $this->sortChildren(false); |
141 | } | ||
142 | } | ||
143 | } | 141 | } |
144 | 142 | ||
145 | public function findPageById(int $id): ?Page | 143 | public function findPageById(int $id): ?Page |