final |
|---|
readonly |
State every emitter needs to do its job.
A family's controller (the dashboard's
{@see \LaravelUi5\Core\Http\Controllers\DashboardController} is the first) constructs
one of these per request and threads it unchanged through the entire
emitter chain. Container emitters (DashboardEmitter, GroupEmitter)
forward the same context to their children's emitters; leaf emitters
(TileEmitter, CardEmitter) consume the parameter pipeline to
resolve getRequiredSlots() per call, and the registry to compose
artifact URLs against Core's canonical slashed-namespace convention.
$context is the request's runtime scope — the same
{@see Ui5ContextInterface} the controller was handed. Whatever the
active layer bound is what flows through: Core-only it's the technical
context; with the SDK installed it's the identity-bearing SdkContext.
The {@see \LaravelUi5\Core\Ui5\Dashboard\Emitters\TileEmitter}
passes it verbally into
{@see \LaravelUi5\Core\Ui5\Capabilities\TileProviderInterface::getTile()}
so a tile can read the actor without smuggling rich, identity-bearing
state through a scalar slot.
final readonly — emitters consume, never mutate. If a future emitter
family needs additional cross-cutting state (e.g. an i18n locale), it's
added here once and every emitter sees it.
$errors is the one exception to "never mutate": its reference is fixed
(the context stays readonly), but it is a mutable collector. Container
emitters write into it when a child's emit() throws and is isolated; the
controller reads it back after the walk to stamp the envelope's errors
array. It defaults to a fresh, production-safe (non-debug) sink so the
dozens of direct new EmitContext(...) call sites in tests need no change.
| Methods | ||
|---|---|---|
public
|
__construct(
ParameterPipelineInterface $pipeline,
Request $request,
Ui5RegistryInterface $registry,
Ui5ContextInterface $context,
EmitErrorSink $errors = new EmitErrorSink(),
)
|
# |
| Properties | |||
|---|---|---|---|
public
|
ParameterPipelineInterface
|
$pipeline
|
# |
public
|
Request
|
$request
|
# |
public
|
Ui5RegistryInterface
|
$registry
|
# |
public
|
Ui5ContextInterface
|
$context
|
# |
public
|
EmitErrorSink
|
$errors
|
# |