ADMIN
'mixedStatus' => 'ACTIVE' // 可以是 UserStatus 或 UserRole
]);
echo $complexUser->role; // 返回complexUserArray 的内容:
// [
// 'role' => 'ADMIN',
// 'mixedStatus' => 'ACTIVE'
// ]
```
##### 回退枚举123, // 使用 CamelCaseMapper 转换
'profile-email' => 'user@example.com' // 仅在 'profile' 分组生效**数据过滤**
- 根据不同场景过滤字段
- 为不同的 API 或用户角色定制数据视图
3.public string $email;
public array $types = ['type1' => 'money', 'type2' => 'score'];
}
// 用户服务类