| Tree |
| [ class tree: Tree ] [ index: Tree ] [ all elements ] |
|
Packages: Tree Files:
Common.php
DBnested.php DBnested.php DBsimple.php Dynamic_DBnested.php Error.php Memory.php Memory_DBnested.php Memory_DBsimple.php Memory_XML.php Options.php OptionsDB.php Tree.php XML.php Classes: |
[ Top ] Method DetailTree_Dynamic_DBnested (Constructor) [line 88]
[ Top ]
add [line 122]
add a new element to the tree there are three ways to use this method 1. give only the $parentId and the $newValues will be inserted as the first child of this parent i.e. // insert a new element under the parent with the ID=7 $tree->add( array('name'=>'new element name') , 7 ); 2. give the $prevId ($parentId will be dismissed) and the new element will be inserted in the tree after the element with the ID=$prevId the parentId is not necessary because the prevId defines exactly where the new element has to be place in the tree, and the parent is the same as for the element with the ID=$prevId i.e. // insert a new element after the element with the ID=5 $tree->add( array('name'=>'new') , 0 , 5 ); 3. neither $parentId nor prevId is given, then the root element will be inserted this requires that programmer is responsible to confirm this this method does not (yet) check if there is already a root element saved !!!
Parameters:
[ Top ]
copy [line 556]
copy a subtree/node/... under a new parent or/and behind a given element
[ Top ]
getChild [line 620]
[ Top ]
getChildren [line 762]
get the children of the given element
[ Top ]
getElement [line 594]
[ Top ]
getFirstRoot [line 906]getLeft [line 680]
gets the element to the left, the left visit
[ Top ]
getNext [line 793]
get the next element on the same level if there is none return false
[ Top ]
getNode [line 923]
gets the tree under the given element in one array, sorted so you can go through the elements from begin to end and list them as they are in the tree, where every child (until the deepest) is retreived
Parameters:
[ Top ]
getParent [line 736]
get the parent of the element with the given id
[ Top ]
getPath [line 651]
gets the path from the element with the given id down to the root the returned array is sorted to start at root for simply walking through and retreiving the path
Overrides Tree_Common::getPath() (gets the path to the element given by its id) [ Top ]
getPrevious [line 825]
get the previous element on the same level if there is none return false
[ Top ]
getRight [line 707]
gets the element to the right, the right visit
[ Top ]
getRoot [line 572]
get the root
[ Top ]
isChildOf [line 856]
returns if $childId is a child of $id
Overrides Tree_Common::isChildOf() (returns if $childId is a child of $id) Parameters:
[ Top ]
move [line 357]
move an entry under a given parent or behind a given entry. If a newPrevId is given the newParentId is dismissed! call it either like this: $tree->move( x , y ) to move the element (or entire tree) with the id x under the element with the id y or $tree->move( x , 0 , y ); // ommit the second parameter by setting it to 0 to move the element (or entire tree) with the id x behind the element with the id y or $tree->move( array(x1,x2,x3) , ... the first parameter can also be an array of elements that shall be moved the second and third para can be as described above If you are using the Memory_DBnested then this method would be invain, since Memory.php already does the looping through multiple elements, but if Dynamic_DBnested is used we need to do the looping here
Parameters:
[ Top ]
remove [line 253]
remove a tree element this automatically remove all children and their children if a node shall be removed that has children
Parameters:
[ Top ]
update [line 520]
update the tree element given by $id with the values in $newValues
Parameters:
[ Top ]
_move [line 387]
this method moves one tree element
Parameters:
[ Top ]
__construct [line 74]
[ Top ]
Documentation generated on Fri, 30 Apr 2004 21:33:49 +0200 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004. |