package |
Default |
---|
__construct(array $config = array(), \InfinityTree\Interfaces\Storage $storage = null, \InfinityTree\Interfaces\Validation $validation = null)
array
Config array, optinal, rewrites rules loaded from file
\InfinityTree\Interfaces\Storage
The adapter for the storage
\InfinityTree\Interfaces\Validation
The validation adapter
addNode(integer $parent = null, string $name) : \InfinityTree\Node
integer
The parent node's ID to add to
string
Name of the node
\InfinityTree\Node
Returns the created node
convertTo(array $tree, string $to, \InfinityTree\Interfaces\Conversion $conversion = null) : mixed
array
The tree in array format
string
The param that decides the output
\InfinityTree\Interfaces\Conversion
If you want, you can pass your own conversion class, it just has to implement the interface
mixed
Returns the output in the format required
deleteNode(integer $id, boolean $delete_subtree = false) : boolean
integer
The id of the node
boolean
If true, deletes the whole subtree, otherwise moves subtree to root
boolean
findNode(mixed $by) : array
mixed
Can be either the id, the slug or the name of the node
array
Returns all the found nodes or empty array if none found
getErrors()
initTree(integer $id)
integer
The id of the tree you want to use
moveNode(integer $node, integer $to, integer $order = 1) : boolean
integer
Id of the node to move
integer
Id of the node to move to, root if null
integer
The place of the moved node on the level it is on Use order like: 2, this means the node will be moved to the second place
boolean
treeAsArray(integer $root = null, boolean $flat = false) : array
integer
The node to start the tree from
boolean
If true, it returns all the children of a given root in a flat array
array
updateNode(integer $id, string $name) : boolean
integer
The id of the node to update (cannot be root)
string
The new name of the node
boolean
_config : array
var |
Holds the configuration array for this library |
---|
array
_storage : \InfnityTree\Interfaces\Storage
var |
Holds the implemented storage adapter |
---|
\InfnityTree\Interfaces\Storage
_validation : \InfinityTree\Interfaces\Validation
var |
Holds the implemented validation adapter |
---|
\InfinityTree\Interfaces\Validation
_tree : \InfinityTree\Tree
var |
Holds the tree we work on |
---|
\InfinityTree\Tree
_errors : array
var |
An associative array with the errors happening during tree handling |
---|
array