db\ActiveRecord loadDefaultValues()

loadDefaultValues() public method

Loads default values from database table schema

You may call this method to load default values after creating a new instance:

// class Customer extends \yii\db\ActiveRecord
$customer = new Customer();
$customer->loadDefaultValues();
public $this loadDefaultValues ( $skipIfSet = true )
$skipIfSet boolean

Whether existing value should be preserved. This will only set defaults for attributes that are null.

return $this

The model instance itself.

doc_Yii
2016-10-30 16:56:21
Comments
Leave a Comment

Please login to continue.