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

update() публичный Метод

Updating a robot name $robot = Robots::findFirst("id=100"); $robot->name = "Biomass"; $robot->update();
public update ( array $data = null, array $whiteList = null ) : void
$data array
$whiteList array
Результат void
    public function update($data = null, $whiteList = null)
    {
        if (is_array($data)) {
            $this->assign($data, $whiteList);
        }
        if ($this->_fireEventCancel('beforeSave') === false || $this->_fireEventCancel('beforeUpdate') === false) {
            throw new ModelException('`:model` model cannot be updated because it has been cancel.', ['model' => get_class($this)]);
        }
        $this->_doLowUpdate();
        $this->_fireEvent('afterUpdate');
        $this->_fireEvent('afterSave');
    }