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