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
$bestowalsTable
private
Table
$bestowalsTable
$recommendationsTable
private
Table
$recommendationsTable
$stateMachineHandler
private
StateMachineHandler
$stateMachineHandler
Methods
__construct()
public
__construct([StateMachineHandler|null $stateMachineHandler = null ]) : mixed
Parameters
- $stateMachineHandler : StateMachineHandler|null = null
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
boolisValidTransition()
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
boolrecommendationHasActiveBestowal()
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
boolrequiresGathering()
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