PHP Class Prado\Data\SqlMap\Statements\TSqlMapObjectCollectionTree

Maps object collection graphs as trees. Nodes in the collection can be {@link add} using parent relationships. The object collections can be build using the {@link collect} method.
Since: 3.1
Inheritance: extends Prado\TComponent
显示文件 Open project: pradosoft/prado

Public Methods

Method Description
__sleep ( )
add ( $parent, $node, $object = '' ) Add a new node to the object tree graph.
collect ( ) : array
isEmpty ( ) : boolean

Protected Methods

Method Description
addNode ( &$childs, $parent, $node ) : boolean Find the parent node and add the new node as its child.
collectChildren ( $parent, &$nodes ) Visit all the child nodes and collect them by removing.
getCollection ( ) : array
hasChildren ( &$nodes ) : boolean
onChildNodesVisited ( $parent, $nodes ) Set the object properties for all the child nodes visited.

Method Details

__sleep() public method

public __sleep ( )

add() public method

Add a new node to the object tree graph.
public add ( $parent, $node, $object = '' )

addNode() protected method

Find the parent node and add the new node as its child.
protected addNode ( &$childs, $parent, $node ) : boolean
return boolean true if parent node is found.

collect() public method

public collect ( ) : array
return array object collection

collectChildren() protected method

Visit all the child nodes and collect them by removing.
protected collectChildren ( $parent, &$nodes )

getCollection() protected method

protected getCollection ( ) : array
return array object collection.

hasChildren() protected method

protected hasChildren ( &$nodes ) : boolean
return boolean true if all nodes are leaf nodes, false otherwise

isEmpty() public method

public isEmpty ( ) : boolean
return boolean true if the graph is empty

onChildNodesVisited() protected method

Set the object properties for all the child nodes visited.
protected onChildNodesVisited ( $parent, $nodes )