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 2384 2008-02-26 16:58:20Z tof $
  • 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, 21 Apr 2008 11:35:36 -0400 by phpDocumentor 1.3.0RC4