protected function _buildWhere($where)
    {
        if (empty($where)) {
            return array('', array());
        }
        if (is_string($where)) {
            return array("WHERE $where", array());
        }
        $conditions = array();
        $values = array();
        foreach ($where as $key => $value) {
            if (is_array($value)) {
                $conditions[] = "$key IN(" . implode(', ', array_fill(0, count($value), '?')) . ')';
                $values = array_merge($values, $value);
            } else {
                $conditions[] = "$key = ?";
                $values[] = $value;
            }
        }
        return array(
            'WHERE ' . implode($conditions, ' AND '),
            $values
        );
    }