public function findParentNodesByChildId($id)
	{
        // To be returned
        $result = array();

        $rl = $this->getRelations();
        $data = $rl[RelationBuilder::TREE_PARAM_ITEMS];

        // If can't find, then return empty array
        if (!isset($data[$id])) {
            return array();
        }

        $current = $data[$id];
        $parentId = $current[RelationBuilder::TREE_PARAM_PARENT_ID];

        while (isset($data[$parentId])) {
            $current = $data[$parentId];
            $parentId = $current[RelationBuilder::TREE_PARAM_PARENT_ID];

            array_push($result, $current);
        }

        return $result;
    }
public function findParentNodesByChildId($id)
	{
        // To be returned
        $result = array();

        $rl = $this->getRelations();
        $data = $rl[RelationBuilder::TREE_PARAM_ITEMS];

        // If can't find, then return empty array
        if (!isset($data[$id])) {
            return array();
        }

        $current = $data[$id];
        $parentId = $current[RelationBuilder::TREE_PARAM_PARENT_ID];

        while (isset($data[$parentId])) {
            $current = $data[$parentId];
            $parentId = $current[RelationBuilder::TREE_PARAM_PARENT_ID];

            array_push($result, $current);
        }

        return $result;
    }
public function findParentNodesByChildId ( $ id ) { // To be returned $ result = array ( ) ; $ rl = $ this -> getRelations ( ) ; $ data = $ rl [ RelationBuilder :: TREE_PARAM_ITEMS ] ; // If can't find, then return empty array if ( ! isset ( $ data [ $ id ] ) ) { return array ( ) ; } $ current = $ data [ $ id ] ; $ parentId = $ current [ RelationBuilder :: TREE_PARAM_PARENT_ID ] ; while ( isset ( $ data [ $ parentId ] ) ) { $ current = $ data [ $ parentId ] ; $ parentId = $ current [ RelationBuilder :: TREE_PARAM_PARENT_ID ] ; array_push ( $ result , $ current ) ; } return $ result ; }
Finds all child nodes

@param array $id Child id
@return array
Finds all child nodes