Changeset 468 for trunk/lib/Hierarchy.inc.php
- Timestamp:
- Feb 20, 2014 3:03:59 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
/branches/eli_branch merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/lib/Hierarchy.inc.php
r441 r468 52 52 * 53 53 */ 54 var$params = array();54 public $params = array(); 55 55 56 56 … … 59 59 * @var string $child_type 60 60 */ 61 var$child_type;61 public $child_type; 62 62 63 63 /** … … 65 65 * @var string $child_id 66 66 */ 67 var$child_id;67 public $child_id; 68 68 69 69 /** … … 72 72 * @var bool $node_init 73 73 */ 74 var$node_init = false;74 public $node_init = false; 75 75 76 76 /** … … 80 80 * configuration or connection parameters. 81 81 */ 82 function Hierarchy($params=array())82 public function __construct($params=array()) 83 83 { 84 84 $this->params = $params; … … 92 92 * if no new ones are specified. 93 93 */ 94 function currentNode($child_type=null, $child_id=null)94 public function currentNode($child_type=null, $child_id=null) 95 95 { 96 96 $old_type = isset($this->child_type) ? $this->child_type : $child_type; … … 113 113 * otherwise if an array is provided, an array of identifiers is returned. 114 114 */ 115 function toStringID($child_type=null, $child_id=null)115 public function toStringID($child_type=null, $child_id=null) 116 116 { 117 117 $app =& App::getInstance(); … … 147 147 * @return mixed Array of node type and id on success, false on failure. 148 148 */ 149 function toArrayID(&$node)149 public function toArrayID(&$node) 150 150 { 151 151 $app =& App::getInstance(); … … 167 167 * @return bool true on success, false on error. 168 168 */ 169 function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='')169 public function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='') 170 170 { 171 171 $app =& App::getInstance(); … … 246 246 * @return bool false on error, true otherwise. 247 247 */ 248 function deleteNode($child_type=null, $child_id=null)248 public function deleteNode($child_type=null, $child_id=null) 249 249 { 250 250 $app =& App::getInstance(); … … 296 296 * @return bool false on error, true otherwise. 297 297 */ 298 function moveNode($new_parents=null, $child_type=null, $child_id=null, $relationship_type=null, $title='')298 public function moveNode($new_parents=null, $child_type=null, $child_id=null, $relationship_type=null, $title='') 299 299 { 300 300 $app =& App::getInstance(); … … 373 373 * @return string The parents as an array of serialized node identifiers. 374 374 */ 375 function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='')375 public function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='') 376 376 { 377 377 $app =& App::getInstance(); … … 424 424 * @return array type, id, title, subnode_quantity. 425 425 */ 426 function getNode($child_type=null, $child_id=null)426 public function getNode($child_type=null, $child_id=null) 427 427 { 428 428 $app =& App::getInstance(); … … 468 468 * @return string The children as an array of serialized node identifiers. 469 469 */ 470 function getChildren($child_type=null, $child_id=null, $type_constraint=null, $order='')470 public function getChildren($child_type=null, $child_id=null, $type_constraint=null, $order='') 471 471 { 472 472 $app =& App::getInstance(); … … 520 520 * @return integer 521 521 */ 522 function getNumberChildren($child_type=null, $child_id=null, $type_constraint=null)522 public function getNumberChildren($child_type=null, $child_id=null, $type_constraint=null) 523 523 { 524 524 $app =& App::getInstance(); … … 561 561 * @return bool true if a leaf, or false if not or an error 562 562 */ 563 function isLeaf($child_type=null, $child_id=null)563 public function isLeaf($child_type=null, $child_id=null) 564 564 { 565 565 $app =& App::getInstance(); … … 595 595 * parent, or false otherwise, or in case of failure. 596 596 */ 597 function isAncestor($child_type, $child_id, $considered_parent_type, $considered_parent_id)597 public function isAncestor($child_type, $child_id, $considered_parent_type, $considered_parent_id) 598 598 { 599 599 $family_tree = $this->getAllAncestors($considered_parent_type, $considered_parent_id); … … 622 622 * @return array Array of serialized node identifiers. 623 623 */ 624 function getAllAncestors($child_type, $child_id, $go_linear=false, $_return_flag=true)624 public function getAllAncestors($child_type, $child_id, $go_linear=false, $_return_flag=true) 625 625 { 626 626 $db =& DB::getInstance(); … … 676 676 * @return bool true if a leaf, or false if not or an error 677 677 */ 678 function nodeExists($child_type=null, $child_id=null, $parent_type=null, $parent_id=null, $relationship_type=null)678 public function nodeExists($child_type=null, $child_id=null, $parent_type=null, $parent_id=null, $relationship_type=null) 679 679 { 680 680 $app =& App::getInstance(); … … 728 728 * specified node: (type, id, title, indent level, selected status) 729 729 */ 730 function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true)730 public function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true) 731 731 { 732 732 $app =& App::getInstance(); … … 801 801 * @param string $type_constraint An array of node types to restrict the search to. 802 802 */ 803 function rebuildSubnodeQty($type_constraint=null)803 public function rebuildSubnodeQty($type_constraint=null) 804 804 { 805 805 $db =& DB::getInstance(); … … 825 825 * all parents recursively. 826 826 */ 827 function setSubnodeQtyToParents($child_type, $child_id, $num_children)827 public function setSubnodeQtyToParents($child_type, $child_id, $num_children) 828 828 { 829 829 $db =& DB::getInstance(); … … 848 848 // THE END 849 849 } 850 851 852 853 854 ?>
Note: See TracChangeset
for help on using the changeset viewer.