## 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 2625 2009-03-19 22:07:39Z godzilla80@gmx.net $
- author: Wei Zhuo <weizhuo[at]gmail[dot]com>

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

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

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

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

- return: object collection
- access: public

array collect ()
collectChildren (line 1077)

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

- return: object collection.
- access: protected

array getCollection ()
hasChildren (line 1063)

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

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

boolean isEmpty ()
onChildNodesVisited (line 1101)

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 Mon, 22 Feb 2010 12:18:11 +0000 by phpDocumentor 1.3.0RC4