redis\ActiveRecord insert()

insert() public method

Inserts the record into the database using the attribute values of this record.

Usage example:

$customer = new Customer;
$customer->name = $name;
$customer->email = $email;
$customer->insert();
public boolean insert ( $runValidation = true, $attributes = null )
$runValidation boolean

Whether to perform validation (calling \yii\redis\Model::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.

$attributes array

List of attributes that need to be saved. Defaults to null, meaning all attributes that are loaded from DB will be saved.

return boolean

Whether the attributes are valid and the record is inserted successfully.

doc_Yii
2016-10-30 17:10:41
Comments
Leave a Comment

Please login to continue.