Whups_Query::deleteNode PHP Method

deleteNode() public method

public deleteNode ( $pathstring )
    public function deleteNode($pathstring)
    {
        $path = Whups_Query::stringToPath($pathstring);
        $qobj =& $this->query;
        if (!strlen($pathstring)) {
            // Deleting the root node isn't supported.
            $GLOBALS['notification']->push(_("Choose New Query instead of deleting the root node."), 'horde.warning');
            return false;
        } else {
            $count = count($path) - 1;
            for ($i = 0; $i < $count; $i++) {
                $qobj =& $qobj['children'][$path[$i]];
            }
            if (!empty($qobj['children'][$path[$count]]['value']) && $this->_getParameterName($qobj['children'][$path[$count]]['value']) !== null) {
                unset($this->parameters[array_search($pn, $this->parameters)]);
            }
            array_splice($qobj['children'], $path[$count], 1);
        }
    }