CI_DB_active_record::set_update_batch PHP Method

set_update_batch() public method

The "set_update_batch" function. Allows key/value pairs to be set for batch updating
public set_update_batch ( $key, $index = '', $escape = TRUE ) : object
return object
    function set_update_batch($key, $index = '', $escape = TRUE)
    {
        $key = $this->_object_to_array_batch($key);
        if (!is_array($key)) {
            // @todo error
        }
        foreach ($key as $k => $v) {
            $index_set = FALSE;
            $clean = array();
            foreach ($v as $k2 => $v2) {
                if ($k2 == $index) {
                    $index_set = TRUE;
                } else {
                    $not[] = $k . '-' . $v;
                }
                if ($escape === FALSE) {
                    $clean[$this->_protect_identifiers($k2)] = $v2;
                } else {
                    $clean[$this->_protect_identifiers($k2)] = $this->escape($v2);
                }
            }
            if ($index_set == FALSE) {
                return $this->display_error('db_batch_missing_index');
            }
            $this->ar_set[] = $clean;
        }
        return $this;
    }