Question : Yii2: Setting default values for all attributes of a model
Answered by : wicked-worm-8hcrxvq84oh5
$customer = new Customer();
$customer->loadDefaultValues();
// $customer->xyz will be assigned the default value declared when defining the "xyz" column
Source : https://www.yiiframework.com/doc/guide/2.0/en/db-active-record | Last Update : Wed, 28 Apr 21