Swat/SwatTreeNode.php
public function &getPath()
    {
        $path = array($this->index);

        $parent = $this->parent;
        while ($parent !== null) {
            $path[] = $parent->index;
            $parent = $parent->parent;
        }

        // we built the path backwards
        $path = array_reverse($path);

        return $path;
    }
public function &getPath()
    {
        $path = array($this->index);

        $parent = $this->parent;
        while ($parent !== null) {
            $path[] = $parent->index;
            $parent = $parent->parent;
        }

        // we built the path backwards
        $path = array_reverse($path);

        return $path;
    }
public function & getPath ( ) { $ path = array ( $ this -> index ) ; $ parent = $ this -> parent ; while ( $ parent !== null ) { $ path [ ] = $ parent -> index ; $ parent = $ parent -> parent ; } // we built the path backwards $ path = array_reverse ( $ path ) ; return $ path ; }
Gets the path to this node

This method travels up the tree until it reaches a node with a parent
of 'null', building a path of ids along the way.

@return array an array of indexes that is the path to the given node
from the root of the current tree.
Gets the path to this node