protected function _reduce(&$node, $method, &$vars)
{
$args = array();
if (isset($node['children'])) {
$count = count($node['children']);
for ($i = 0; $i < $count; $i++) {
$result = $this->_reduce($node['children'][$i], $method, $vars);
$args[] = $result;
}
}
if ($node['type'] == Whups_Query::TYPE_CRITERION) {
$value = $node['value'];
$pn = $this->_getParameterName($value);
if ($pn !== null) {
$value = $vars->get($pn);
}
return call_user_func($method, $args, Whups_Query::TYPE_CRITERION, $node['criterion'], $node['cvalue'], $node['operator'], $value);
}
return call_user_func($method, $args, $node['type'], null, null, null, null);
}