ApprovalContext
in package
Value object representing display context for a pending approval.
Carries the title, description, structured fields, and metadata needed to render an approval card in the unified approvals UI.
Table of Contents
Properties
- $description : string
- $entityUrl : string|null
- $fields : array<string|int, mixed>
- $icon : string
- $requester : string|null
- $requesterMemberId : int|null
- $title : string
Methods
- __construct() : mixed
- getDescription() : string
- getEntityUrl() : string|null
- getFields() : array<int, array{label: string, value: string}>
- getIcon() : string
- getRequester() : string|null
- getRequesterMemberId() : int|null
- getTitle() : string
- toArray() : array<string, mixed>
- Serialize to a plain array for JSON responses or template consumption.
Properties
$description read-only
private
string
$description
$entityUrl read-only
private
string|null
$entityUrl
= null
$fields read-only
private
array<string|int, mixed>
$fields
= []
$icon read-only
private
string
$icon
= 'bi-question-circle'
$requester read-only
private
string|null
$requester
= null
$requesterMemberId read-only
private
int|null
$requesterMemberId
= null
$title read-only
private
string
$title
Methods
__construct()
public
__construct(string $title, string $description[, array<int, array{label: string, value: string}> $fields = [] ][, string|null $entityUrl = null ][, string $icon = 'bi-question-circle' ][, string|null $requester = null ][, int|null $requesterMemberId = null ]) : mixed
Parameters
- $title : string
-
Summary line, e.g. "Authorization Request: Heavy Fighting"
- $description : string
-
Longer explanation of what is being approved
- $fields : array<int, array{label: string, value: string}> = []
-
Key/value display pairs
- $entityUrl : string|null = null
-
Link back to the entity under review
- $icon : string = 'bi-question-circle'
-
Bootstrap icon class, e.g. 'bi-shield-check'
- $requester : string|null = null
-
Display name of the person who initiated the request
- $requesterMemberId : int|null = null
-
Member ID snapshot for filtering and joins
getDescription()
public
getDescription() : string
Return values
stringgetEntityUrl()
public
getEntityUrl() : string|null
Return values
string|nullgetFields()
public
getFields() : array<int, array{label: string, value: string}>
Return values
array<int, array{label: string, value: string}>getIcon()
public
getIcon() : string
Return values
stringgetRequester()
public
getRequester() : string|null
Return values
string|nullgetRequesterMemberId()
public
getRequesterMemberId() : int|null
Return values
int|nullgetTitle()
public
getTitle() : string
Return values
stringtoArray()
Serialize to a plain array for JSON responses or template consumption.
public
toArray() : array<string, mixed>