yii\db\ActiveRecordInterface::update PHP Method

update() public method

Usage example: php $customer = Customer::findOne($id); $customer->name = $name; $customer->email = $email; $customer->update();
public update ( boolean $runValidation = true, array $attributeNames = null ) : integer | boolean
$runValidation boolean whether to perform validation (calling [[\yii\base\Model::validate()|validate()]]) before saving the record. Defaults to `true`. If the validation fails, the record will not be saved to the database and this method will return `false`.
$attributeNames array list of attributes that need to be saved. Defaults to `null`, meaning all attributes that are loaded from DB will be saved.
return integer | boolean the number of rows affected, or `false` if validation fails or updating process is stopped for other reasons. Note that it is possible that the number of rows affected is 0, even though the update execution is successful.
    public function update($runValidation = true, $attributeNames = null);