src/Entity/Entity.php
private function update()
    {
        if (count($this->modified_fields)) {
            $updates = [];

            foreach ($this->modified_fields as $modified_field) {
                $updates[$modified_field] = $this->values[$modified_field];
            }

            if ($this->primary_key_modified) {
                $old_id = isset($this->old_values['id']) ? $this->old_values['id'] : $this->getId();

                if ($this->pool->exists(get_class($this), $this->getId())) {
                    throw new LogicException('Object #' . $this->getId() . " can't be overwritten");
                } else {
                    $this->connection->update($this->table_name, $updates, $this->getWherePartById($old_id));
                }
            } else {
                $this->connection->update($this->table_name, $updates, $this->getWherePartById($this->getId()));
            }

            $this->values = array_merge($this->values, $this->refreshGeneratedFieldValues($this->getId()));
            $this->setAsLoaded();
        }
    }
private function update()
    {
        if (count($this->modified_fields)) {
            $updates = [];

            foreach ($this->modified_fields as $modified_field) {
                $updates[$modified_field] = $this->values[$modified_field];
            }

            if ($this->primary_key_modified) {
                $old_id = isset($this->old_values['id']) ? $this->old_values['id'] : $this->getId();

                if ($this->pool->exists(get_class($this), $this->getId())) {
                    throw new LogicException('Object #' . $this->getId() . " can't be overwritten");
                } else {
                    $this->connection->update($this->table_name, $updates, $this->getWherePartById($old_id));
                }
            } else {
                $this->connection->update($this->table_name, $updates, $this->getWherePartById($this->getId()));
            }

            $this->values = array_merge($this->values, $this->refreshGeneratedFieldValues($this->getId()));
            $this->setAsLoaded();
        }
    }
Update database record.