final |
|---|
readonly |
Declarative slot definition for the Core Parameter API.
Applied on a Ui5ModuleInterface class (mirrors the #[Role] convention).
Repeatable: a module declares every slot it owns by stacking #[Slot]
attributes on its module class. Ui5Registry harvests these at boot,
builds the catalog, and auto-expands each slot into a synthetic
Setting with key slot.{name} (D14). On an artifact class it fails at
boot — PHP cannot narrow the attribute target to modules, so the
registry checks it instead.
Note is mandatory — every slot must declare its purpose in one short
sentence. Empty strings fail validation at boot. note: 'TBD' is
permitted as a deliberate placeholder.
editable semantics. A governance hint, and no more. Core is
auth-blind and enforces nothing; its one reader is the slot-to-setting
auto-expansion, which carries the level into the synthetic setting
(Ui5Registry::autoExpandSlotToSetting()). Whether a storage layer checks
it is that layer's decision — the SDK's actor-value writer does not. The
default EditLevel::Administrator is conservative — declaring a slot
user-editable is an opt-in.
Type restriction. ParameterType::Model is forbidden — slots are wire-shaped values, not foreign-key references. Validation at boot raises LogicException.
Defaults. Must not be null, and must already have the slot's type —
both checked at boot. A Date/DateTime default may instead be one of the
sentinels in DateSentinelResolver::SENTINELS (@today, @now,
@first-of-month), resolved at read time; any other @… string fails
at boot. Literal values (e.g. 9999-12-31) pass through unchanged.
Example
#[Slot(
name: CoreSlots::Currency,
type: ParameterType::String,
default: 'EUR',
editable: EditLevel::User,
note: 'ISO 4217 currency code.'
)]
class CoreModule extends AbstractUi5Module { … }
| Methods | ||
|---|---|---|
public
|
__construct(
string|BackedEnum $name,
ParameterType $type,
string $note,
mixed $default,
EditLevel $editable = EditLevel::Administrator,
)
|
# |
| Properties | |||
|---|---|---|---|
public
|
string|BackedEnum
|
$name
|
# |
public
|
ParameterType
|
$type
|
# |
public
|
string
|
$note
|
# |
public
|
mixed
|
$default
|
# |
public
|
EditLevel
|
$editable
|
# |