Declarative setting definition for Configurable classes.
Apply this attribute multiple times on a class (e.g., Action handler, Resource/Data provider, Report provider) to declare the settings it depends on.
When to Use Settings vs. Custom Database Models
The Settings API is designed for lightweight, flexible configuration values that can be expressed as simple key–value pairs (strings, numbers, booleans, arrays, dates). It works well when the configuration is UI-driven, ephemeral, or low-risk:
By contrast, a custom database model should be used when the configuration expresses a business relationship or critical domain rule:
Rule of Thumb
If a value is ephemeral, UI-scoped, or best-effort → Settings are pragmatic and safe. If a value is domain-critical, audited, or relational in nature → design a dedicated DB model.
Notes
Weak foreign keys in Settings (e.g., arrays of BusinessPartner IDs) are acceptable if you sanitize them at runtime (ignore IDs that no longer exist). Settings should always store JSON-safe primitives (string, int, float, bool, date in ISO-8601, arrays thereof). You trade off referential integrity for developer speed. This is intentional.
Example
key: 'billing.settlement.validation.maxHours',
type: ValueType::Integer,
default: 8,
scope: SettingScope::Tenant,
visibilityRole: SettingVisibilityRole::TenantAdmin
)]```
| Methods | ||
|---|---|---|
public
|
__construct(
string $setting,
ValueType $type = ValueType::String,
mixed $default = null,
SettingScope $scope = SettingScope::Tenant,
SettingVisibilityRole $role = SettingVisibilityRole::TenantAdmin,
string $note,
)
|
# |
| Properties | |||
|---|---|---|---|
public
|
string
|
$setting
|
# |
public
|
ValueType
|
$type
|
# |
public
|
mixed
|
$default
|
# |
public
|
SettingScope
|
$scope
|
# |
public
|
SettingVisibilityRole
|
$role
|
# |
public
|
string
|
$note
|
# |