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.

  • author: Wei Zhuo <weizhuo[at]gmail[dot]com>
  • version: $Id: TMappedStatement.php 3112 2012-02-14 08:13:27Z ctrlaltca@gmail.com $
  • since: 3.1

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

TComponent
   |
   --TSqlMapObjectCollectionTree
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)
void __sleep ()
Methods
add (line 1011)

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

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 1067)
  • return: object collection
  • access: public
array collect ()
collectChildren (line 1092)

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 1147)
  • return: object collection.
  • access: protected
array getCollection ()
hasChildren (line 1078)
  • 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 1000)
  • return: true if the graph is empty
  • access: public
boolean isEmpty ()
onChildNodesVisited (line 1116)

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.
__sleep (line 1152)
  • access: public
void __sleep ()

Redefinition of:
TComponent::__sleep()
Returns an array with the names of all variables of that object that should be serialized.

Inherited Methods

Inherited From TComponent

TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()

Documentation generated on Mon, 25 Jun 2012 14:38:42 +0200 by phpDocumentor 1.4.3