/**
* Make a sql condition string
*
* @return string
**/
function render() {
if ( is_numeric($this->value) || in_array(strtoupper($this->operator), array('IN', 'NOT IN'))) {
$value = $this->value;
} else {
if ( '' === ($value = trim($this->value)) ) {
return '';
}
if ( (substr($value, 0, 1) != '`') && (substr($value, -1) != '`') ) {
$value = "'$value'";
}
}
$clause = (!empty($this->prefix) ? "{$this->prefix}." : "") . $this->column;
if ( !empty($this->function) ) {
$clause = sprintf($this->function, $clause);
}
$clause .= " {$this->operator} $value";
return $clause;
}