save() public abstract method
Saves the current record.
This method will call insert() when isNewRecord is true, or update() when isNewRecord is false.
For example, to save a customer record:
$customer = new Customer; // or $customer = Customer::findOne($id); $customer->name = $name; $customer->email = $email; $customer->save();
public abstract boolean save ( $runValidation = true, $attributeNames = null ) | ||
---|---|---|
$runValidation | boolean |
Whether to perform validation (calling \yii\db\Model::validate()) before saving the record. Defaults to |
$attributeNames | array |
List of attribute names that need to be saved. Defaults to |
return | boolean |
Whether the saving succeeded (i.e. no validation errors occurred). |
Please login to continue.