Granada\ORM::_build_update PHP Method

_build_update() protected method

Build an UPDATE query
protected _build_update ( )
    protected function _build_update()
    {
        $query = array();
        $query[] = "UPDATE {$this->_quote_identifier($this->_table_name)} SET";
        $field_list = array();
        foreach ($this->_dirty_fields as $key => $value) {
            if (!array_key_exists($key, $this->_expr_fields)) {
                $value = '?';
            }
            $field_list[] = "{$this->_quote_identifier($key)} = {$value}";
        }
        $query[] = join(", ", $field_list);
        $query[] = "WHERE";
        $query[] = $this->_quote_identifier($this->_get_id_column_name());
        $query[] = "= ?";
        return join(" ", $query);
    }
ORM