<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* Constructor for the tree.
*
- * @param $nodeName
+ * @param string $nodeName
*
- * @internal param string $root
+ * @internal param string $rootNode
*
* @return CRM_Utils_Tree
- * @access public
*/
public function __construct($nodeName) {
// create the root node
/**
* Find a node that matches the given string
*
- * @param string $name name of the node we are searching for.
+ * @param string $name
+ * Name of the node we are searching for.
* @param array (ref) $parentNode which parent node should we search in ?
*
* @return array(
- ref) | false node if found else false
- *
- * @access public
+ ref) | false node if found else false
*/
//public function &findNode(&$parentNode, $name)
public function &findNode($name, &$parentNode) {
}
/**
- * Function to check if node is a leaf node.
+ * Check if node is a leaf node.
* Currently leaf nodes are strings and non-leaf nodes are arrays
*
* @param array(
- ref) $node node which needs to checked
+ ref) $node node which needs to checked
*
* @return boolean
- *
- * @access public
*/
public function isLeafNode(&$node) {
return (count($node['children']) ? TRUE : FALSE);
*
* @param string $name
*
- * @return array (ref)
- *
- * @access public
+ * @return array
+ * (ref)
*/
public function &createNode($name) {
$node['name'] = $name;
/**
* Add node
*
- * @param string $parentName - name of the parent ?
- * @param array (ref) - node to be added
+ * @param string $parentName
+ * Name of the parent ?.
+ * @param array (ref) - node to be added
*
* @return void
- *
- * @access public
*/
public function addNode($parentName, &$node) {
$temp = '';
/**
* Add Data
*
- * @param string $parentName - name of the parent ?
- * @param mixed - data to be added
- * @param string - key to be used (optional)
+ * @param string $parentName
+ * Name of the parent ?.
+ * @param mixed - data to be added
+ * @param string - key to be used (optional)
*
* @return void
- *
- * @access public
*/
public function addData($parentName, $childName, $data) {
$temp = '';
* @param none
*
* @return tree
- *
- * @access public
*/
public function getTree() {
return $this->tree;
}
/**
- * print the tree
+ * Print the tree
*
* @param none
*
* @return void
- *
- * @access public
*/
public function display() {
print_r($this->tree);
}
}
-