public function fetchTree($rootSearchRule, $depth, $globalSearchRule = "") {
        $this->depth = $depth;
        $this->globalSearchRule = $globalSearchRule;

        // query on given search rule
        $searchRule = "(" . $rootSearchRule . ")";
        if ($globalSearchRule != "")
            $searchRule .= " AND (" . $globalSearchRule . ")";
        $recordList = $this->directFetch($searchRule);
        if (!$recordList) {
            $this->rootNodes = array();
            return;
        }
        foreach ($recordList as $rec) {
            $this->rootNodes[] = new NodeRecord($rec);
        }
        if ($this->depth <= 1)
            return $this->rootNodes;
        if (is_array($this->rootNodes)) {
            foreach ($this->rootNodes as $node) {
                $this->_getChildrenNodes($node, 1);
            }
        }
        return $this->rootNodes;
    }
public function fetchTree($rootSearchRule, $depth, $globalSearchRule = "") {
        $this->depth = $depth;
        $this->globalSearchRule = $globalSearchRule;

        // query on given search rule
        $searchRule = "(" . $rootSearchRule . ")";
        if ($globalSearchRule != "")
            $searchRule .= " AND (" . $globalSearchRule . ")";
        $recordList = $this->directFetch($searchRule);
        if (!$recordList) {
            $this->rootNodes = array();
            return;
        }
        foreach ($recordList as $rec) {
            $this->rootNodes[] = new NodeRecord($rec);
        }
        if ($this->depth <= 1)
            return $this->rootNodes;
        if (is_array($this->rootNodes)) {
            foreach ($this->rootNodes as $node) {
                $this->_getChildrenNodes($node, 1);
            }
        }
        return $this->rootNodes;
    }
public function fetchTree ( $ rootSearchRule , $ depth , $ globalSearchRule = "" ) { $ this -> depth = $ depth ; $ this -> globalSearchRule = $ globalSearchRule ; // query on given search rule $ searchRule = "(" . $ rootSearchRule . ")" ; if ( $ globalSearchRule != "" ) $ searchRule .= " AND (" . $ globalSearchRule . ")" ; $ recordList = $ this -> directFetch ( $ searchRule ) ; if ( ! $ recordList ) { $ this -> rootNodes = array ( ) ; return ; } foreach ( $ recordList as $ rec ) { $ this -> rootNodes [ ] = new NodeRecord ( $ rec ) ; } if ( $ this -> depth <= 1 ) return $ this -> rootNodes ; if ( is_array ( $ this -> rootNodes ) ) { foreach ( $ this -> rootNodes as $ node ) { $ this -> _getChildrenNodes ( $ node , 1 ) ; } } return $ this -> rootNodes ; }
Fetch records in tree structure

@return <type>
Fetch records in tree structure