protected function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ', $escape = NULL)
{
if ($key === NULL or $values === NULL) {
return $this;
}
if (!is_array($values)) {
$values = array($values);
}
is_bool($escape) or $escape = $this->_protect_identifiers;
$not = $not ? ' NOT' : '';
if ($escape === TRUE) {
$where_in = array();
foreach ($values as $value) {
$where_in[] = $this->escape($value);
}
} else {
$where_in = array_values($values);
}
$prefix = count($this->qb_where) === 0 && count($this->qb_cache_where) === 0 ? $this->_group_get_type('') : $this->_group_get_type($type);
$where_in = array('condition' => $prefix . $key . $not . ' IN(' . implode(', ', $where_in) . ')', 'escape' => $escape);
$this->qb_where[] = $where_in;
if ($this->qb_caching === TRUE) {
$this->qb_cache_where[] = $where_in;
$this->qb_cache_exists[] = 'where';
}
return $this;
}