@@ 174-187 (lines=14) @@ | ||
171 | * |
|
172 | * @return static |
|
173 | */ |
|
174 | public function addChildren($children, $mapper = null) |
|
175 | { |
|
176 | if (is_null($children)) { |
|
177 | return $this; |
|
178 | } |
|
179 | ||
180 | $children = $this->parseChildren($children, $mapper); |
|
181 | ||
182 | $element = clone $this; |
|
183 | ||
184 | $element->children = $element->children->merge($children); |
|
185 | ||
186 | return $element; |
|
187 | } |
|
188 | ||
189 | /** |
|
190 | * Alias for `addChildren`. |
|
@@ 251-260 (lines=10) @@ | ||
248 | * |
|
249 | * @return static |
|
250 | */ |
|
251 | public function prependChildren($children, $mapper = null) |
|
252 | { |
|
253 | $children = $this->parseChildren($children, $mapper); |
|
254 | ||
255 | $element = clone $this; |
|
256 | ||
257 | $element->children = $children->merge($element->children); |
|
258 | ||
259 | return $element; |
|
260 | } |
|
261 | ||
262 | /** |
|
263 | * Alias for `prependChildren`. |