\Kaloa\Util\TreeFactory

Summary

Methods
Properties
Constants
fromArray()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

fromArray()

fromArray(array  $array) : \Kaloa\Util\Tree\Node

Creates a tree structure from an array and returns the root element

$a has to be a list of (key, parent_key, value) triplets. Keys will not be preserved, they are only used to define the initial tree hierarchy. The value part may be any kind of object, array or scalar value.

Parameters

array $array

Returns

\Kaloa\Util\Tree\Node

Root element