CI_DB_query_builder::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 = NULL ) : CI_DB_query_builder
return CI_DB_query_builder
    public function set_update_batch($key, $index = '', $escape = NULL)
    {
        $key = $this->_object_to_array_batch($key);
        if (!is_array($key)) {
            // @todo error
        }
        is_bool($escape) or $escape = $this->_protect_identifiers;
        foreach ($key as $k => $v) {
            $index_set = FALSE;
            $clean = array();
            foreach ($v as $k2 => $v2) {
                if ($k2 === $index) {
                    $index_set = TRUE;
                }
                $clean[$this->protect_identifiers($k2, FALSE, $escape)] = $escape === FALSE ? $v2 : $this->escape($v2);
            }
            if ($index_set === FALSE) {
                return $this->display_error('db_batch_missing_index');
            }
            $this->qb_set[] = $clean;
        }
        return $this;
    }