public function rules()
{
return array_merge(parent::rules(), [[['created_by', 'updated_by', 'created_at', 'updated_at', 'property_id', 'priority'], 'integer'], [['value'], 'required'], [['value'], 'string', 'max' => 255], [['def'], 'string', 'max' => 1], [['code'], 'string', 'max' => 32], ['code', 'default', 'value' => function ($model, $attribute) {
return md5(rand(1, 10) . time());
}], ['priority', 'default', 'value' => function ($model, $attribute) {
return 500;
}]]);
}