Public Member Functions | |
__construct () | |
getTree () | |
load ($parentNode=null) | |
loadNode ($nodeId) | |
appendChild ($data=array(), $parentNode, $prevNode=null) | |
addNode ($node, $parent=null) | |
moveNodeTo ($node, $parentNode, $prevNode=null) | |
copyNodeTo ($node, $parentNode, $prevNode=null) | |
removeNode ($node) | |
createNode ($parentNode, $prevNode=null) | |
getChild ($node) | |
getChildren ($node) | |
getNodes () | |
getNodeById ($nodeId) | |
getPath ($node) | |
Protected Attributes | |
$_nodes |
Definition at line 35 of file Tree.php.
__construct | ( | ) |
Enter description here...
Reimplemented in Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Tree.
Definition at line 49 of file Tree.php.
00050 { 00051 $this->_nodes = new Varien_Data_Tree_Node_Collection($this); 00052 }
addNode | ( | $ | node, | |
$ | parent = null | |||
) |
Enter description here...
Varien_Data_Tree_Node | $node | |
Varien_Data_Tree_Node | $parent |
Definition at line 110 of file Tree.php.
00111 { 00112 $this->_nodes->add($node); 00113 $node->setParent($parent); 00114 if (!is_null($parent) && ($parent instanceof Varien_Data_Tree_Node) ) { 00115 $parent->addChild($node); 00116 } 00117 return $node; 00118 }
appendChild | ( | $ | data = array() , |
|
$ | parentNode, | |||
$ | prevNode = null | |||
) |
Enter description here...
array|Varien_Data_Tree_Node | $data | |
Varien_Data_Tree_Node | $parentNode | |
Varien_Data_Tree_Node | $prevNode |
Reimplemented in Varien_Data_Tree_Db.
Definition at line 90 of file Tree.php.
00091 { 00092 if (is_array($data)) { 00093 $node = $this->addNode( 00094 new Varien_Data_Tree_Node($data, $parentNode->getIdField(), $this), 00095 $parentNode 00096 ); 00097 } elseif ($data instanceof Varien_Data_Tree_Node) { 00098 $node = $this->addNode($data, $parentNode); 00099 } 00100 return $node; 00101 }
copyNodeTo | ( | $ | node, | |
$ | parentNode, | |||
$ | prevNode = null | |||
) |
Enter description here...
Varien_Data_Tree_Node | $node | |
Varien_Data_Tree_Node | $parentNode | |
Varien_Data_Tree_Node | $prevNode |
Definition at line 138 of file Tree.php.
createNode | ( | $ | parentNode, | |
$ | prevNode = null | |||
) |
Enter description here...
Varien_Data_Tree_Node | $parentNode | |
Varien_Data_Tree_Node | $prevNode |
Definition at line 164 of file Tree.php.
getChild | ( | $ | node | ) |
Enter description here...
Varien_Data_Tree_Node | $node |
Definition at line 173 of file Tree.php.
getChildren | ( | $ | node | ) |
Enter description here...
Varien_Data_Tree_Node | $node |
Definition at line 182 of file Tree.php.
getNodeById | ( | $ | nodeId | ) |
Enter description here...
unknown_type | $nodeId |
Definition at line 202 of file Tree.php.
getNodes | ( | ) |
Enter description here...
Definition at line 191 of file Tree.php.
getPath | ( | $ | node | ) |
Enter description here...
Varien_Data_Tree_Node | $node |
Definition at line 213 of file Tree.php.
00214 { 00215 if ($node instanceof Varien_Data_Tree_Node ) { 00216 00217 } elseif (is_numeric($node)){ 00218 if ($_node = $this->getNodeById($node)) { 00219 return $_node->getPath(); 00220 } 00221 } 00222 return array(); 00223 }
getTree | ( | ) |
load | ( | $ | parentNode = null |
) |
Enter description here...
Varien_Data_Tree_Node | $parentNode |
Definition at line 69 of file Tree.php.
loadNode | ( | $ | nodeId | ) |
Enter description here...
unknown_type | $nodeId |
Reimplemented in Varien_Data_Tree_Db, and Varien_Data_Tree_Dbp.
Definition at line 78 of file Tree.php.
moveNodeTo | ( | $ | node, | |
$ | parentNode, | |||
$ | prevNode = null | |||
) |
Enter description here...
Varien_Data_Tree_Node | $node | |
Varien_Data_Tree_Node | $parentNode | |
Varien_Data_Tree_Node | $prevNode |
Reimplemented in Varien_Data_Tree_Db.
Definition at line 127 of file Tree.php.
removeNode | ( | $ | node | ) |
Enter description here...
Varien_Data_Tree_Node | $node |
Reimplemented in Varien_Data_Tree_Db.
Definition at line 148 of file Tree.php.
00149 { 00150 $this->_nodes->delete($node); 00151 if ($node->getParent()) { 00152 $node->getParent()->removeChild($node); 00153 } 00154 unset($node); 00155 return $this; 00156 }