src/Data/Tools/BizRecord.php
final public function getToSaveFields($type)
    {
        // TODO: if join != null, get columns only for the join
        $sqlFields = array();

        // expand input fields with oncreate or onupdate fields
        $inputFields = $this->inputFields;
        foreach ($this->varValue as $key => $field) {
            if (($type == 'UPDATE' && $field->valueOnUpdate != null) || ($type == 'CREATE' && $field->valueOnCreate != null)) {
                if (!in_array($key, $this->inputFields))
                    $inputFields[] = $key;
            }
        }

        foreach ($inputFields as $key) {
            // ignore the composite key Id field
            if ($key == "Id" && count($this->keyFieldColumnMap) > 1)
                continue;
            $field = $this->varValue[$key];
            // do not consider joined columns
            if ($field->column && !$field->join) {
                $sqlFields[] = $field;
            }
        }
        return $sqlFields;
    }
final public function getToSaveFields($type)
    {
        // TODO: if join != null, get columns only for the join
        $sqlFields = array();

        // expand input fields with oncreate or onupdate fields
        $inputFields = $this->inputFields;
        foreach ($this->varValue as $key => $field) {
            if (($type == 'UPDATE' && $field->valueOnUpdate != null) || ($type == 'CREATE' && $field->valueOnCreate != null)) {
                if (!in_array($key, $this->inputFields))
                    $inputFields[] = $key;
            }
        }

        foreach ($inputFields as $key) {
            // ignore the composite key Id field
            if ($key == "Id" && count($this->keyFieldColumnMap) > 1)
                continue;
            $field = $this->varValue[$key];
            // do not consider joined columns
            if ($field->column && !$field->join) {
                $sqlFields[] = $field;
            }
        }
        return $sqlFields;
    }
Get insert/update fields.
Ignore unchanged field in UPDATE case

@return array field value pair array