1 | <?php |
||
18 | final class Factory |
||
19 | { |
||
20 | /** |
||
21 | * Creates a tree structure from an array and returns the root element |
||
22 | * |
||
23 | * $a has to be a list of (key, parent_key, value) triplets. Keys will not |
||
24 | * be preserved, they are only used to define the initial tree hierarchy. |
||
25 | * The value part may be any kind of object, array or scalar value. |
||
26 | * |
||
27 | * @param array $array |
||
28 | * @return Node Root element |
||
29 | */ |
||
30 | 4 | public function fromArray(array $array) |
|
72 | } |
||
73 |