Private Member Functions |
| | add_node (&$intoNode, $key, $data, $parent) |
| & | find_node (&$node, $key) |
Constructor & Destructor Documentation
Member Function Documentation
| sd_tree::add |
( |
|
$key, |
|
|
|
$data, |
|
|
|
$parent_key = null |
|
) |
| |
Adds a node to the tree.
- Parameters
-
| $key | Unique key of this node. |
| $data | Mixed array to store with this key. |
| $parent_key | Parent key, if any, under which to store this key. |
| sd_tree::add_node |
( |
& |
$intoNode, |
|
|
|
$key, |
|
|
|
$data, |
|
|
|
$parent |
|
) |
| |
|
private |
| & sd_tree::find_node |
( |
& |
$node, |
|
|
|
$key |
|
) |
| |
|
private |
Tries to find a node with a specific key.
Acts as a recursive function of itself.
- Parameters
-
| $node | Node whose subnodes to search. |
| $key | Key to search for. |
- Returns
- The found node, else false.
| sd_tree::get_data |
( |
|
$key | ) |
|
Returns the data of a specific key.
- Parameters
-
- Returns
- The key's data, else false if the key wasn't found.
| sd_tree::get_subnodes |
( |
|
$key = null | ) |
|
Returns a list of subnode keys of the root or an existing node.
- Parameters
-
| $key | Get the subnodes keys of this key. |
- Returns
- Array of subnode keys, else false if the key doesn't exist.
| sd_tree::set_data |
( |
|
$key, |
|
|
|
$new_data |
|
) |
| |
Sets the data of a key.
- Parameters
-
| $key | Key whose data we're replacing. |
| $new_data | The new data. |
Member Data Documentation
| sd_tree::$node_orphans = array() |
The documentation for this class was generated from the following file: