Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
Keyword

Class TSqlMapObjectCollectionTree


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
Author: Wei Zhuo <weizhuo[at]gmail[dot]com>

Method Summary
void
add ( string $parent, string $node, mixed $object)
Add a new node to the object tree graph.
protected  boolean
addNode ( array &$childs, string $parent, string $node)
Find the parent node and add the new node as its child.
array
collect ()
protected  void
collectChildren ( string $parent, array &$nodes)
Visit all the child nodes and collect them by removing.
protected  array
protected  boolean
hasChildren ( array &$nodes)
boolean
isEmpty ()
protected  void
onChildNodesVisited ( string $parent, array $nodes)
Set the object properties for all the child nodes visited.

Method Details

add

public void add (string $parent , string $node , mixed $object )

Add a new node to the object tree graph.

Input
string$parentparent node id
string$nodenew node id
mixed$objectnode value
Output
Exception

addNode

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

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

Input
array&$childslist of nodes to check
string$parentparent node id
string$nodenew node id
Output
boolean true if parent node is found.
Exception

collect

public array collect ()

Output
array object collection
Exception

collectChildren

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

Visit all the child nodes and collect them by removing.

Input
string$parentparent node id
array&$nodeslist of child nodes.
Output
Exception

getCollection

protected array getCollection ()

Output
array object collection.
Exception

hasChildren

protected boolean hasChildren (array &$nodes )

Input
array&$nodeslist of nodes to check
Output
boolean true if all nodes are leaf nodes, false otherwise
Exception

isEmpty

public boolean isEmpty ()

Output
boolean true if the graph is empty
Exception

onChildNodesVisited

protected void onChildNodesVisited (string $parent , array $nodes )

Set the object properties for all the child nodes visited.

Input
string$parentparent node id
array$nodeslist of child nodes visited.
Output
Exception