IP.Board  3.3.0
classNodes Class Reference

Public Member Functions

 __construct ()
 __call ($method, $arguments)
 addNode ($parentId, $data)
 debugShowTree ()
 deleteBranch ($nodeId)
 deleteNode ($nodeId)
 dropCache ()
 fetchBranch ($nodeId, $inWhere='')
 fetchChildren ($nodeId, $inWhere='')
 fetchNodeContent ($nodeId)
 fetchNodeInfo ($nodeId)
 fetchParentInfo ($nodeId, $where= '')
 fetchParents ($nodeId, $inWhere='')
 fetchSlice ($nodeId, $inWhere='')
 fetchTree ($where='')
 init (array $settings)
 isDescendantOf ($desc, $parent)
 moveNode ($nodeId, $newParentId)
 movePosition ($id1, $id2, $position='after')
 nextRow ()
 rebuildTree ($root=0, $left=1, $depth=-1)
 recordCount ()

Protected Attributes

 $_debugMsgs = array()
 $_nodeCache = array()
 $_sqlFolderFlag = ''
 $_sqlJoins = ''
 $_sqlLimit = null
 $_sqlNodeLeft = ''
 $_sqlNodeLevel = ''
 $_sqlNodeRight = ''
 $_sqlOrder = ''
 $_sqlParentID = ''
 $_sqlPrimaryID = ''
 $_sqlSelect = '*'
 $_sqlTable = ''
 $_sqlTblPrefix = ''
 $_sqlTitle = ''
 $_sqlWhere = ''
 $cache
 $caches
 $DB
 $lang
 $member
 $memberData
 $registry
 $request
 $settings

Constructor & Destructor Documentation

Method constructor

public

Parameters:
objectRegistry Object
arrayArray of settings: [ 'sqlPrimaryID' (the SQL table field for the item ID) 'sqlParentID' (the SQL table field for the parent ID) 'sqlTitle' (the SQL table field for the item title) 'sqlSelect' (the SQL table select fields (* by default)) 'sqlTable' (the SQL table name) 'sqlNodeLevel' (the SQL table field for the node level) 'sqlNodeLeft' (the SQL table field for node left) 'sqlNodeRight' (the SQL table field for node right) 'sqlWhere' (Any additional 'where' information *Optional) ]
Returns:
void

Member Function Documentation

__call ( method,
arguments 
)

Allow set/get data

addNode ( parentId,
data 
)

Add node

Parameters:
intParent Node ID
arrayArray of fields to insert
Returns:
int Insert ID

Show the entire tree as HITMUHL

public

deleteBranch ( nodeId)

Delete a node branch (node + children)

Parameters:
intNode ID
Returns:
boolean
deleteNode ( nodeId)

Delete a node. Any children are moved to root.

Parameters:
intNode ID
Returns:
boolean
dropCache ( )

Drop the node cache

fetchBranch ( nodeId,
inWhere = '' 
)

Fetch the branch starting with $nodeId

public

Parameters:
intNode Id
stringWhere clause
Returns:
boolean
fetchChildren ( nodeId,
inWhere = '' 
)

Fetch the children of $nodeId

public

Parameters:
intNode Id
stringWhere clause
Returns:
boolean
fetchNodeContent ( nodeId)

Fetches a single node's content

public

Parameters:
int
Returns:
array
fetchNodeInfo ( nodeId)

Fetches left/right/level data

public

Parameters:
int
Returns:
array - left, right, level
fetchParentInfo ( nodeId,
where = '' 
)

Fetches parent info

public

Parameters:
intNode id
stringWhere data
Returns:
DB row
fetchParents ( nodeId,
inWhere = '' 
)

Fetch the parents of $nodeId

public

Parameters:
intNode Id
stringWhere clause
Returns:
boolean
fetchSlice ( nodeId,
inWhere = '' 
)

Returns an item with parents and children

public

Parameters:
intNode Id
stringWhere clause
Returns:
boolean
fetchTree ( where = '')

Returns DB resource to all nodes

public

Parameters:
stringWhere string
Returns:
boolean
isDescendantOf ( desc,
parent 
)

Is descendant of Checks to see if a node is a descendant of another node. Simple really

Parameters:
arraynode (descendant)
arraynode (root parent)
moveNode ( nodeId,
newParentId 
)

Move and node and all children to a new parent node

Parameters:
intNode ID
intNew parent ID
Returns:
int Insert ID
movePosition ( id1,
id2,
position = 'after' 
)

Switch a node's position within it's level

public

Parameters:
intID1
intID 2
stringposition (before/after)
Returns:
boolean
nextRow ( )

Returns the current row.

Returns:
array
rebuildTree ( root = 0,
left = 1,
depth = -1 
)

Rebuild the tree

public

Parameters:
intRoot ID
intLeft value
intDepth
Returns:
nothing

Returns record count

Returns:
int

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables