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;
    }