KMP PHP API Reference

AwardsWorkflowConditions
in package
uses LocatorAwareTrait, WorkflowContextAwareTrait

Workflow condition evaluators for the Awards plugin.

Each method accepts workflow context and config, returns bool.

Table of Contents

Properties

$bestowalsTable  : Table
$recommendationsTable  : Table
$stateMachineHandler  : StateMachineHandler

Methods

__construct()  : mixed
hasRequiredFields()  : bool
Validate that all required fields for a target state are present on the entity.
isValidTransition()  : bool
Check if a state transition is allowed per the state machine configuration.
recommendationHasActiveBestowal()  : bool
Check whether a recommendation is linked to an active bestowal.
requiresGathering()  : bool
Check if the target state requires a gathering_id to be set.
requiresGivenDate()  : bool
Check if the target state requires a given date.
resolveValue()  : mixed
Resolve a config value from context if it starts with '$.'.

Properties

Methods

hasRequiredFields()

Validate that all required fields for a target state are present on the entity.

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

Current workflow context

$config : array<string|int, mixed>

Config with recommendationId, targetState

Return values
bool

isValidTransition()

Check if a state transition is allowed per the state machine configuration.

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

Current workflow context

$config : array<string|int, mixed>

Config with currentState, targetState

Return values
bool

recommendationHasActiveBestowal()

Check whether a recommendation is linked to an active bestowal.

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

Current workflow context

$config : array<string|int, mixed>

Config with recommendationId

Return values
bool

requiresGathering()

Check if the target state requires a gathering_id to be set.

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

Current workflow context

$config : array<string|int, mixed>

Config with targetState

Return values
bool

True if the target state requires a gathering assignment

requiresGivenDate()

Check if the target state requires a given date.

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

Current workflow context

$config : array<string|int, mixed>

Config with targetState

Return values
bool

True if the target state requires a given date

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

On this page

Search results