📜  Yii2:为模型的所有属性设置默认值 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:42.942000             🧑  作者: Mango

代码示例1
$customer = new Customer();
$customer->loadDefaultValues();
// $customer->xyz will be assigned the default value declared when defining the "xyz" column