src/Ease/SQL/Orm.php
public function updateToSQL($data = null)
    {
        if (is_null($this->myTable)) {
            return;
        }

        if (is_null($data)) {
            $data        = $this->getData();
            $useInObject = true;
        } else {
            $useInObject = false;
        }

        if (!count($data)) {
            $this->addStatusMessage(_('UpdateToSQL: Missing data'), 'error');

            return;
        }

        if (!isset($data[$this->keyColumn])) {
            $key = $this->getMyKey();
            if (is_null($key)) {
                $this->addStatusMessage(get_class($this).':UpdateToSQL: Unknown keyColumn:'.$this->keyColumn.' '.
                    json_encode($data), 'error');

                return;
            }
        } else {
            $key = $data[$this->keyColumn];
            unset($data[$this->keyColumn]);
        }

        if (isset($this->myLastModifiedColumn) && !isset($data[$this->myLastModifiedColumn])) {
            $data[$this->myLastModifiedColumn] = 'NOW()';
        }

        $cc       = $this->dblink->getColumnComma();
        $queryRaw = SQL::$upd.$cc.$this->myTable.$cc.' SET '.$this->dblink->arrayToSetQuery($data).SQL::$whr.$cc.$this->keyColumn.$cc." = '".$this->dblink->addSlashes($key)."'";
        if ($this->dblink->exeQuery($queryRaw)) {
            if ($useInObject) {
                return $this->data[$this->keyColumn];
            } else {
                return $key;
            }
        }

        return;
    }
public function updateToSQL($data = null)
    {
        if (is_null($this->myTable)) {
            return;
        }

        if (is_null($data)) {
            $data        = $this->getData();
            $useInObject = true;
        } else {
            $useInObject = false;
        }

        if (!count($data)) {
            $this->addStatusMessage(_('UpdateToSQL: Missing data'), 'error');

            return;
        }

        if (!isset($data[$this->keyColumn])) {
            $key = $this->getMyKey();
            if (is_null($key)) {
                $this->addStatusMessage(get_class($this).':UpdateToSQL: Unknown keyColumn:'.$this->keyColumn.' '.
                    json_encode($data), 'error');

                return;
            }
        } else {
            $key = $data[$this->keyColumn];
            unset($data[$this->keyColumn]);
        }

        if (isset($this->myLastModifiedColumn) && !isset($data[$this->myLastModifiedColumn])) {
            $data[$this->myLastModifiedColumn] = 'NOW()';
        }

        $cc       = $this->dblink->getColumnComma();
        $queryRaw = SQL::$upd.$cc.$this->myTable.$cc.' SET '.$this->dblink->arrayToSetQuery($data).SQL::$whr.$cc.$this->keyColumn.$cc." = '".$this->dblink->addSlashes($key)."'";
        if ($this->dblink->exeQuery($queryRaw)) {
            if ($useInObject) {
                return $this->data[$this->keyColumn];
            } else {
                return $key;
            }
        }

        return;
    }
Perform SQL record update.
Provede update záznamu do SQL.

@param array $data

@return int Id záznamu nebo null v případě chyby