Untitled
public text v1 · immutablefunction _where($key, $value = NULL, $type = 'AND ')
{
if ( ! is_array($key))
{
$key = array($key => $value);
}
foreach ($key as $k => $v)
{
$prefix = (count($this->ar_where) == 0) ? '' : $type;
if ( ! is_null($v))
{
if ( ! $this->_has_operator($k))
{
$k = '`' . $k . '` =';
}
$v = ' '.$this->escape($v);
}
else
{
$k = '`' . $k . '` IS NULL';
}
$this->ar_where[] = $prefix.$k.$v;
}
return $this;
}