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