| @@ 192-205 (lines=14) @@ | ||
| 189 | * |
|
| 190 | * @return static |
|
| 191 | */ |
|
| 192 | public function addChildren($children, $mapper = null) |
|
| 193 | { |
|
| 194 | if (is_null($children)) { |
|
| 195 | return $this; |
|
| 196 | } |
|
| 197 | ||
| 198 | $children = $this->parseChildren($children, $mapper); |
|
| 199 | ||
| 200 | $element = clone $this; |
|
| 201 | ||
| 202 | $element->children = $element->children->merge($children); |
|
| 203 | ||
| 204 | return $element; |
|
| 205 | } |
|
| 206 | ||
| 207 | /** |
|
| 208 | * Alias for `addChildren`. |
|
| @@ 269-278 (lines=10) @@ | ||
| 266 | * |
|
| 267 | * @return static |
|
| 268 | */ |
|
| 269 | public function prependChildren($children, $mapper = null) |
|
| 270 | { |
|
| 271 | $children = $this->parseChildren($children, $mapper); |
|
| 272 | ||
| 273 | $element = clone $this; |
|
| 274 | ||
| 275 | $element->children = $children->merge($element->children); |
|
| 276 | ||
| 277 | return $element; |
|
| 278 | } |
|
| 279 | ||
| 280 | /** |
|
| 281 | * Alias for `prependChildren`. |
|