function _having($key, $value = '', $type = 'AND ', $escape = TRUE)
{
if (!is_array($key)) {
$key = array($key => $value);
}
foreach ($key as $k => $v) {
$prefix = count($this->ar_having) == 0 ? '' : $type;
if ($escape === TRUE) {
$k = $this->_protect_identifiers($k);
}
if (!$this->_has_operator($k)) {
$k .= ' = ';
}
if ($v != '') {
$v = ' ' . $this->escape_str($v);
}
$this->ar_having[] = $prefix . $k . $v;
if ($this->ar_caching === TRUE) {
$this->ar_cache_having[] = $prefix . $k . $v;
$this->ar_cache_exists[] = 'having';
}
}
return $this;
}