## Class TSqlMapObjectCollectionTree

Description

TSQLMapObjectCollectionTree class.

Maps object collection graphs as trees. Nodes in the collection can be add using parent relationships. The object collections can be build using the collect method.

- since: 3.1
- version: $Id: TMappedStatement.php 1578 2006-12-17 22:20:50Z wei $
- author: Wei Zhuo <weizhuo[at]gmail[dot]com>

Located in /Data/SqlMap/Statements/TMappedStatement.php (line 959)

Method Summary
void add (string $parent, string $node, [mixed $object = ''])
boolean addNode (array &$childs, string $parent, string $node)
array collect ()
void collectChildren (string $parent, array &$nodes)
array getCollection ()
boolean hasChildren (array &$nodes)
boolean isEmpty ()
void onChildNodesVisited (string $parent, array $nodes)
Methods
add (line 988)

Add a new node to the object tree graph.

- access: public

void add (string $parent, string $node, [mixed $object = ''])

- string $parent: parent node id
- string $node: new node id
- mixed $object: node value

addNode (line 1020)

Find the parent node and add the new node as its child.

- return: true if parent node is found.
- access: protected

boolean addNode (array &$childs, string $parent, string $node)

- array &$childs: list of nodes to check
- string $parent: parent node id
- string $node: new node id

collect (line 1044)

- return: object collection
- access: public

array collect ()
collectChildren (line 1069)

Visit all the child nodes and collect them by removing.

- access: protected

void collectChildren (string $parent, array &$nodes)

- string $parent: parent node id
- array &$nodes: list of child nodes.

getCollection (line 1124)

- return: object collection.
- access: protected

array getCollection ()
hasChildren (line 1055)

- return: true if all nodes are leaf nodes, false otherwise
- access: protected

boolean hasChildren (array &$nodes)

- array &$nodes: list of nodes to check

isEmpty (line 977)

- return: true if the graph is empty
- access: public

boolean isEmpty ()
onChildNodesVisited (line 1093)

Set the object properties for all the child nodes visited.

- access: protected

void onChildNodesVisited (string $parent, array $nodes)

- string $parent: parent node id
- array $nodes: list of child nodes visited.

Documentation generated on Sun, 14 Jan 2007 21:43:28 -0500 by phpDocumentor 1.3.0RC4