SGL_NestedSetA lightweight wrapper to PEAR DB_NestedSet that bypasses NestedSet for most methods, querying the specified nested set table directly via PEAR DB; more complex, write-heavy methods are left to DB_NestedSet.
Located in /SGL/NestedSet.php (line 50)
mixed
$params
= array('tableStructure' =>
mixed
$_aNodes
= array() (line 86)
array
$_images
= array(Array of images for addImages() to use to decorate results, relative to root.
mixed
$_protectedFields
= array('id', 'rootid', 'l', 'r', 'norder', 'level', 'parent') (line 70)
Constructor SGL_NestedSet (line 100)
addImages (line 449)
Takes a reference to a nodes array such as returned by getTree() et. al. and adds to
each node array an array of images that can be used to build a MS Windows Explorer-like tree view, with images for file, folder, blank, and I, L, and T shapes, as well as up and down arrows that are grayed out when the node cannot be moved up or down (has no siblings above or below it).
createLeftNode (line 638)
createRightNode (line 646)
createRootNode (line 624)
The following are all just wrappers to DB_NestedSet, an instance of which is returned by _getNestedSet(). See PEAR/DB/NestedSet.php for API docs.
createSubNode (line 630)
deleteNode (line 662)
getBranch (line 221)
For any node whose id is supplied, fetches branch for that node (all nodes with same root_id), including that node, and those above and below it.
getBreadcrumbs (line 396)
Returns "breadcrumbs," a node's ancestral path through the tree: same rootid, and a level less than this node's, and a left node less than this node's, and a right node greater than this node's.
getChildren (line 302)
For any node, fetches child nodes (nodes with same rootid, with level = parent level + 1, with l between parent's l and r).
getNode (line 365)
Returns the node indentified by supplied id, or false.
getParent (line 284)
getRoots (line 144)
Fetches all root nodes (rootid = id) from the entire table/tree.
getSubBranch (line 257)
For any node, fetches all descendents (kids, grandkids, etc.)of that node (nodes with same rootid and with left ids bounded by this node's left and right id, and which aren't this node).
getTree (line 180)
Fetches all nodes from all roots, i.e., the entire table/tree.
moveTree (line 654)
prepareValues (line 549)
Prepares $values array for insert or update into table. Called with $quoteValues=true to build quoted key=value strings for update sql.
Called externally with $quoteValues=false to simply weed out of an array any fields that either are not in the table or that are but are internal.
setImage (line 122)
setImages (line 128)
singleton (line 88)
updateNode (line 520)
Updates defined fields (any field defined in params['tableStructure'] that is not a NestedSet field such as l, r, rootid, norder, etc. (i.e. not in _protectedFields).
_addSQL (line 339)
Borrowed from PEAR DB_NestedSet. Formats various sql clauses.
_cleanMemoryCache (line 675)
Clean nodes stored in memory
_getDb (line 111)
_getNestedSet (line 587)
DB_NestedSet_DB factory. Called only by wrapper methods.
Several methods (createRootNode() and moveTree()) when called from DB_NestedSet directly take constants as parameters, but since DB_NestedSet isn't instantiated at call time, we pass the constants' values instead. Values for $pos are: 'BE' (move node before target norder), 'AF' (move node after target norder), or 'SUB' (move node beneath, as a child to target). See PEAR DB_NestedSet docs for api info on wrapper methods.
Documentation generated on Tue, 23 Feb 2010 18:14:31 +0000 by phpDocumentor 1.4.3