protected function _createTree( MW_DB_Result_Interface $result, MW_Tree_Node_Interface $node )
	{
		while( ( $record = $result->fetch() ) !== false )
		{
			$newNode = $this->_createNode( $record );

			while( $this->_isChild( $newNode, $node ) )
			{
				$node->addChild( $newNode );

				if( ( $newNode = $this->_createTree( $result, $newNode ) ) === false ) {
					return false;
				}
			}

			return $newNode;
		}

		return false;
	}
protected function _createTree( MW_DB_Result_Interface $result, MW_Tree_Node_Interface $node )
	{
		while( ( $record = $result->fetch() ) !== false )
		{
			$newNode = $this->_createNode( $record );

			while( $this->_isChild( $newNode, $node ) )
			{
				$node->addChild( $newNode );

				if( ( $newNode = $this->_createTree( $result, $newNode ) ) === false ) {
					return false;
				}
			}

			return $newNode;
		}

		return false;
	}
protected function _createTree ( MW_DB_Result_Interface $ result , MW_Tree_Node_Interface $ node ) { while ( ( $ record = $ result -> fetch ( ) ) !== false ) { $ newNode = $ this -> _createNode ( $ record ) ; while ( $ this -> _isChild ( $ newNode , $ node ) ) { $ node -> addChild ( $ newNode ) ; if ( ( $ newNode = $ this -> _createTree ( $ result , $ newNode ) ) === false ) { return false ; } } return $ newNode ; } return false ; }
Creates a tree from the result set returned by the database.

@param MW_DB_Result_Interface $result Database result
@param MW_Tree_Node_Interface $node Current node to add children to
@return MW_Tree_Node_Interface Parent node containing the children
Creates a tree from the result set returned by the database .