ManaPHP\Mvc\Model::_doLowUpdate PHP Метод

_doLowUpdate() защищенный Метод

Sends a pre-build UPDATE SQL statement to the relational database system
protected _doLowUpdate ( ) : void
Результат void
    protected function _doLowUpdate()
    {
        $conditions = [];
        foreach ($this->modelsMetadata->getPrimaryKeyAttributes($this) as $attributeField) {
            if (!isset($this->{$attributeField})) {
                throw new ModelException('`:model` model cannot be updated because some primary key value is not provided', ['model' => get_class($this)]);
            }
            $conditions[$attributeField] = $this->{$attributeField};
        }
        $columnValues = [];
        foreach ($this->modelsMetadata->getAttributes($this) as $attributeField) {
            if (isset($this->{$attributeField})) {
                /** @noinspection NestedPositiveIfStatementsInspection */
                if (!isset($this->_snapshot[$attributeField]) || $this->{$attributeField} !== $this->_snapshot[$attributeField]) {
                    $columnValues[$attributeField] = $this->{$attributeField};
                }
            }
        }
        if (count($columnValues) === 0) {
            return;
        }
        $this->getWriteConnection()->update($this->getSource(), $columnValues, $conditions);
        $this->_snapshot = $this->toArray();
    }