KMP PHP API Reference

ActivitiesWorkflowActions
in package
uses QueuedMailerAwareTrait, WorkflowContextAwareTrait

Workflow action implementations for activity authorization operations.

Delegates authorization lifecycle operations to AuthorizationManagerInterface to avoid duplicating business logic.

Table of Contents

Properties

$mailer  : Mailer
$authManager  : AuthorizationManagerInterface

Methods

__construct()  : mixed
Constructor.
activateAuthorization()  : array<string|int, mixed>
Activate a fully-approved authorization (set status, start ActiveWindow, assign role).
createAuthorizationRequest()  : array<string|int, mixed>
Create authorization request.
handleDenial()  : array<string|int, mixed>
Process denial of an authorization request.
notifyApprover()  : array<string|int, mixed>
Send approval request email to designated approver.
notifyRequester()  : array<string|int, mixed>
Send status update email to requesting member.
resolveApprovers()  : array<string|int, mixed>
Resolve eligible approvers for an activity in a branch.
retractAuthorization()  : array<string|int, mixed>
Retract (cancel) a pending authorization request.
revokeAuthorization()  : array<string|int, mixed>
Revoke an active authorization.
validateRenewalEligibility()  : array<string|int, mixed>
Check if a member is eligible to renew an authorization for an activity.
queueMail()  : Mailer
Returns a mailer instance.
queueMailJob()  : void
Queues a mail job to be processed later.
resolveValue()  : mixed
Resolve a config value from context if it starts with '$.'.
sendMailNow()  : Mailer
Returns a mailer instance.
buildMemberCardUrl()  : string
Build a member card URL.
resolveAuthorizationId()  : int
Resolve persisted entity metadata before trigger data and legacy action parameters.

Properties

Methods

activateAuthorization()

Activate a fully-approved authorization (set status, start ActiveWindow, assign role).

public activateAuthorization(array<string|int, mixed> $context, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
$context : array<string|int, mixed>

Current workflow context

$config : array<string|int, mixed>

Config with authorizationId, approverId

Return values
array<string|int, mixed>

Output with activated boolean and memberRoleId

createAuthorizationRequest()

Create authorization request.

public createAuthorizationRequest(array<string|int, mixed> $context, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
$context : array<string|int, mixed>

Current workflow context

$config : array<string|int, mixed>

Config with memberId, activityId, approverId, isRenewal

Return values
array<string|int, mixed>

Output with authorizationId

handleDenial()

Process denial of an authorization request.

public handleDenial(array<string|int, mixed> $context, array<string|int, mixed> $config) : array<string|int, mixed>

Looks up the pending approval record by authorizationId since the workflow definition passes authorizationId, not authorizationApprovalId.

Parameters
$context : array<string|int, mixed>

Current workflow context

$config : array<string|int, mixed>

Config with authorizationId, approverId, denyReason

Return values
array<string|int, mixed>

Output with denied boolean

notifyApprover()

Send approval request email to designated approver.

public notifyApprover(array<string|int, mixed> $context, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
$context : array<string|int, mixed>

Current workflow context

$config : array<string|int, mixed>

Config with activityId, requesterId, approverId, authorizationToken

Return values
array<string|int, mixed>

Output with sent boolean

notifyRequester()

Send status update email to requesting member.

public notifyRequester(array<string|int, mixed> $context, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
$context : array<string|int, mixed>

Current workflow context

$config : array<string|int, mixed>

Config with activityId, requesterId, approverId, status, nextApproverId

Return values
array<string|int, mixed>

Output with sent boolean

resolveApprovers()

Resolve eligible approvers for an activity in a branch.

public resolveApprovers(array<string|int, mixed> $context, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
$context : array<string|int, mixed>

Current workflow context

$config : array<string|int, mixed>

Config with activityId, branchId, excludeMemberIds (optional)

Return values
array<string|int, mixed>

Output with approvers array

retractAuthorization()

Retract (cancel) a pending authorization request.

public retractAuthorization(array<string|int, mixed> $context, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
$context : array<string|int, mixed>

Current workflow context

$config : array<string|int, mixed>

Config with authorizationId, requesterId

Return values
array<string|int, mixed>

Output with retracted boolean

revokeAuthorization()

Revoke an active authorization.

public revokeAuthorization(array<string|int, mixed> $context, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
$context : array<string|int, mixed>

Current workflow context

$config : array<string|int, mixed>

Config with authorizationId, revokerId, revokedReason

Return values
array<string|int, mixed>

Output with revoked boolean

validateRenewalEligibility()

Check if a member is eligible to renew an authorization for an activity.

public validateRenewalEligibility(array<string|int, mixed> $context, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
$context : array<string|int, mixed>

Current workflow context

$config : array<string|int, mixed>

Config with memberId, activityId

Return values
array<string|int, mixed>

Output with eligible boolean and reason string

queueMail()

Returns a mailer instance.

protected queueMail(string $name, mixed $action, mixed $to, mixed $vars) : Mailer
Parameters
$name : string

Mailer's name.

$action : mixed
$to : mixed
$vars : mixed
Tags
throws
MissingMailerException

if undefined mailer class.

Return values
Mailer

queueMailJob()

Queues a mail job to be processed later.

protected queueMailJob(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

Data to be passed to the mailer.

resolveValue()

Resolve a config value from context if it starts with '$.'.

protected resolveValue(mixed $value, array<string|int, mixed> $context) : mixed
Parameters
$value : mixed

Raw value or context path (e.g. '$.trigger.memberId')

$context : array<string|int, mixed>

Current workflow context

Return values
mixed

Resolved value

sendMailNow()

Returns a mailer instance.

protected sendMailNow(array<string|int, mixed> $data) : Mailer
Parameters
$data : array<string|int, mixed>
Tags
throws
MissingMailerException

if undefined mailer class.

Return values
Mailer

buildMemberCardUrl()

Build a member card URL.

private buildMemberCardUrl(int $memberId) : string
Parameters
$memberId : int

Member ID

Return values
string

URL to member card

resolveAuthorizationId()

Resolve persisted entity metadata before trigger data and legacy action parameters.

private resolveAuthorizationId(array<string|int, mixed> $context, array<string|int, mixed> $config) : int

Conflicting authoritative references must fail instead of mutating a different authorization.

Parameters
$context : array<string|int, mixed>

Engine-owned action context

$config : array<string|int, mixed>

Resolved action configuration

Return values
int

Authorization ID

On this page

Search results