public function insertCriterion($pathstring, $criterion, $cvalue, $operator, $value)
{
$path = Whups_Query::stringToPath($pathstring);
$qobj =& $this->query;
$value = trim($value);
if ($value[0] == '"') {
// FIXME: The last character should be '"' as well.
$value = substr($value, 1, -1);
} else {
$pn = $this->_getParameterName($value);
if ($pn !== null) {
$this->parameters[] = $pn;
}
}
$newbranch = array('type' => Whups_Query::TYPE_CRITERION, 'criterion' => $criterion, 'cvalue' => $cvalue, 'operator' => $operator, 'value' => $value);
$count = count($path);
for ($i = 0; $i < $count; $i++) {
$qobj =& $qobj['children'][$path[$i]];
}
$qobj['children'][] = $newbranch;
}