## 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 1911 2007-05-08 08:06:13Z wei $
- author: Wei Zhuo <weizhuo[at]gmail[dot]com>

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

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 995)

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 1027)

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 1051)

- return: object collection
- access: public

array collect ()
collectChildren (line 1076)

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 1131)

- return: object collection.
- access: protected

array getCollection ()
hasChildren (line 1062)

- 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 984)

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

boolean isEmpty ()
onChildNodesVisited (line 1100)

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, 30 Sep 2007 19:16:42 -0400 by phpDocumentor 1.3.0RC4