| Methods |
public
|
__construct(
Ui5ArtifactInterface $artifact,
TenantInterface $tenant,
Partner $actor,
Partner $principal,
string $locale,
Carbon $at,
AbilitySetInterface $abilities,
OrgPartnerResolver $orgPartnerResolver,
array<string, mixed> $settings = [],
array<string, mixed> $appSettings = [],
)
Parameters
| $settings |
the resolved settings snapshot for
{@see artifact()} — all of the artifact's settings, scope-resolved
(Platform < Installation < Tenant < Site < User — Core's Scope),
read once at construction. Held as a
flat key => value map, mirroring how the ability snapshot is held.
|
| $appSettings |
the same, for the artifact's app — the
root artifact of its module (D17). For a request that addresses the app itself
it is the same map as $settings.
|
|
#
|
public
|
artifact(): Ui5ArtifactInterface
|
#
|
public
|
tenant(): TenantInterface
|
#
|
public
|
actor(): Partner
|
#
|
public
|
principal(): Partner
|
#
|
public
|
locale(): string
|
#
|
public
|
at(): Carbon
|
#
|
public
|
abilities(): AbilitySetInterface
|
#
|
public
|
setting(string $key): mixed
A resolved setting value for {@see artifact()} by key, or null when the key
is not among the artifact's settings — the…
A resolved setting value for {@see artifact()} by key, or null when the key
is not among the artifact's settings — the artifact's own declarations, which for
an action are not its app's ({@see appSetting()}). Read from the snapshot injected at
construction — this context merely holds the map (it never calls the
Settings domain), so identity-scoped configuration reads the same way as
{@see abilities()}. The value is decoded ('CHF', 1000, true, an
array), scope-resolved (Core's Scope: Platform < Installation < Tenant < Site < User).
|
#
|
public
|
appSetting(string $key): mixed
A resolved setting of the artifact's **app** by key, or null when the app does not
declare it (D17).
A resolved setting of the artifact's app by key, or null when the app does not
declare it (D17).
The app is the root artifact of the artifact's module — getModule()->getArtifactRoot():
for a request that addresses the app, or its OData service, the app itself; for an
action, a resource, a card or a dashboard, the app they belong to. Resolved like
{@see setting()}: decoded, scope-resolved for the acting partner, read once at
construction.
A tile or chart renders inside its dashboard's request and shares that context — so a
tile contributed from another module reads the dashboard's app here, not its own.
|
#
|
public
|
appSettings(): array<string, mixed>
Every resolved setting of the artifact's app — the map {@see appSetting()} reads, and
the one `context.json` delivers…
Every resolved setting of the artifact's app — the map {@see appSetting()} reads, and
the one context.json delivers to the client as settings.
Returns
|
#
|
public
|
primaryOrgPartner(Carbon $at): ?Partner
The single organization partner the {@see actor()} is a primary
employee of at $at, or null when none (fail-closed).…
The single organization partner the {@see actor()} is a primary
employee of at $at, or null when none (fail-closed). Convenience
over {@see orgPartners()} for the strict-B2B 1:1 employee→employer
case; returns the first when the actor has multiple primary
employments.
Distinct from {@see tenant()}: the tenant is the owner of the site
(the SaaS account boundary); org partners are actor-related — the
business the logged-in person acts on behalf of. No collision.
|
#
|
public
|
orgPartners(Carbon $at): Partner[]
All organization partners the {@see actor()} is a primary employee
of at $at, hydrated. Empty when the actor has no…
All organization partners the {@see actor()} is a primary employee
of at $at, hydrated. Empty when the actor has no active primary
employment as of $at — fail-closed, mirroring
{@see \LaravelUi5\Sdk\Partners\Contracts\ScopeResolverInterface}.
Delegates the partner-graph walk to the injected {@see OrgPartnerResolver}
(the same primitive behind #[ScopedToOrgActors], so host rebinding of
employment semantics flows through the factory that builds this context).
Resolves fresh on each call: the result is a pure function of
($at, partner graph), so the immutable context holds no cache. A caller
reading it repeatedly at the same moment should hold the result itself.
|
#
|