concrete/src/Tree/Node/Node.php
public function getTreeNodeParentArray()
    {
        $db = Database::connection();
        $nodeArray = [];
        $currentNodeParentID = $this->getTreeNodeParentID();
        if ($currentNodeParentID > 0) {
            while (is_numeric($currentNodeParentID) && $currentNodeParentID > 0 && $currentNodeParentID) {
                $row = $db->fetchAssoc('select treeNodeID, treeNodeParentID from TreeNodes where treeNodeID = ?', [$currentNodeParentID]);
                if ($row && $row['treeNodeID']) {
                    $nodeArray[] = self::getByID($row['treeNodeID']);
                }

                $currentNodeParentID = $row['treeNodeParentID']; // moving up the tree until we hit 1
            }
        }

        return $nodeArray;
    }
public function getTreeNodeParentArray()
    {
        $db = Database::connection();
        $nodeArray = [];
        $currentNodeParentID = $this->getTreeNodeParentID();
        if ($currentNodeParentID > 0) {
            while (is_numeric($currentNodeParentID) && $currentNodeParentID > 0 && $currentNodeParentID) {
                $row = $db->fetchAssoc('select treeNodeID, treeNodeParentID from TreeNodes where treeNodeID = ?', [$currentNodeParentID]);
                if ($row && $row['treeNodeID']) {
                    $nodeArray[] = self::getByID($row['treeNodeID']);
                }

                $currentNodeParentID = $row['treeNodeParentID']; // moving up the tree until we hit 1
            }
        }

        return $nodeArray;
    }
public function getTreeNodeParentArray ( ) { $ db = Database :: connection ( ) ; $ nodeArray = [ ] ; $ currentNodeParentID = $ this -> getTreeNodeParentID ( ) ; if ( $ currentNodeParentID > 0 ) { while ( is_numeric ( $ currentNodeParentID ) && $ currentNodeParentID > 0 && $ currentNodeParentID ) { $ row = $ db -> fetchAssoc ( 'select treeNodeID, treeNodeParentID from TreeNodes where treeNodeID = ?' , [ $ currentNodeParentID ] ) ; if ( $ row && $ row [ 'treeNodeID' ] ) { $ nodeArray [ ] = self :: getByID ( $ row [ 'treeNodeID' ] ) ; } $ currentNodeParentID = $ row [ 'treeNodeParentID' ] ; // moving up the tree until we hit 1 } } return $ nodeArray ; }
Returns an array of all parents of this tree node.
Returns an array of all parents of this tree node .