KMP PHP API Reference

ApprovalContextRendererRegistry
in package

Static registry for approval context renderers.

Plugins register renderers keyed by source name. When the approvals UI needs display context for a workflow instance, the registry iterates registered renderers and returns the first match, falling back to a generic default context.

Follows the same static-registry pattern as WorkflowActionRegistry.

Table of Contents

Properties

$contextCache  : array<string, ApprovalContext>
$initialized  : bool
$renderers  : array<string, ApprovalContextRendererInterface>

Methods

clear()  : void
Clear all registered renderers. Primarily for testing.
getAllRenderers()  : array<string, ApprovalContextRendererInterface>
Get all registered renderers.
getDefaultContext()  : ApprovalContext
Build a generic fallback context when no renderer matches.
getRegisteredSources()  : array<int, string>
Get all registered source identifiers.
isRegistered()  : bool
Check if a source has a registered renderer.
register()  : void
Register a renderer for a given source (e.g. 'Authorizations', 'Awards').
render()  : ApprovalContext
Render approval context for a workflow instance.
unregister()  : void
Remove the renderer for a specific source.
contextCacheKey()  : string|null
Build a request-local cache key for persisted workflow instances.
ensureInitialized()  : void
Ensure the registry is initialized.

Properties

Methods

getRegisteredSources()

Get all registered source identifiers.

public static getRegisteredSources() : array<int, string>
Return values
array<int, string>

isRegistered()

Check if a source has a registered renderer.

public static isRegistered(string $source) : bool
Parameters
$source : string

Source identifier

Return values
bool

unregister()

Remove the renderer for a specific source.

public static unregister(string $source) : void
Parameters
$source : string

Source identifier

On this page

Search results