| @@ 295-307 (lines=13) @@ | ||
| 292 | public function create_xml($path = null) |
|
| 293 | { |
|
| 294 | // Was a path specified? If so, use that array. |
|
| 295 | if ($path !== null) |
|
| 296 | { |
|
| 297 | $path = $this->path($path); |
|
| 298 | ||
| 299 | // The path was not found |
|
| 300 | if ($path === false) |
|
| 301 | return false; |
|
| 302 | ||
| 303 | $path = $path->array; |
|
| 304 | } |
|
| 305 | // Just use the current array. |
|
| 306 | else |
|
| 307 | $path = $this->array; |
|
| 308 | ||
| 309 | // Add the xml declaration to the front. |
|
| 310 | return '<?xml version="1.0"?' . '>' . $this->_xml($path, 0); |
|
| @@ 324-336 (lines=13) @@ | ||
| 321 | public function to_array($path = null) |
|
| 322 | { |
|
| 323 | // Are we doing a specific path? |
|
| 324 | if ($path !== null) |
|
| 325 | { |
|
| 326 | $path = $this->path($path); |
|
| 327 | ||
| 328 | // The path was not found |
|
| 329 | if ($path === false) |
|
| 330 | return false; |
|
| 331 | ||
| 332 | $path = $path->array; |
|
| 333 | } |
|
| 334 | // No, so just use the current array. |
|
| 335 | else |
|
| 336 | $path = $this->array; |
|
| 337 | ||
| 338 | return $this->_array($path); |
|
| 339 | } |
|