CoreConditions
in package
Core workflow condition evaluators: field comparisons, permission checks, and expressions.
Table of Contents
Properties
Methods
- __construct() : mixed
- evaluateExpression() : bool
- Evaluate a simple expression against the workflow context.
- fieldEquals() : bool
- Check if a context field equals a specific value.
- fieldGreaterThan() : bool
- Check if a numeric field exceeds a threshold.
- fieldNotEmpty() : bool
- Check if a context field has a non-empty value.
- memberHasPermission() : bool
- Check if a member has a specific permission.
- resolveFieldPath() : mixed
- Resolve a dot-separated field path from context.
- compare() : bool
- Compare two values with a given operator.
Properties
$expressionEvaluator
private
ExpressionEvaluator
$expressionEvaluator
Methods
__construct()
public
__construct([ExpressionEvaluator|null $expressionEvaluator = null ]) : mixed
Parameters
- $expressionEvaluator : ExpressionEvaluator|null = null
evaluateExpression()
Evaluate a simple expression against the workflow context.
public
evaluateExpression(array<string|int, mixed> $context, array<string|int, mixed> $config) : bool
Supports basic comparisons: field == value, field != value, field > value, field < value, field >= value, field <= value.
Parameters
- $context : array<string|int, mixed>
-
Current workflow context
- $config : array<string|int, mixed>
-
Config with 'expression' string
Return values
boolfieldEquals()
Check if a context field equals a specific value.
public
fieldEquals(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 'field' (path) and 'value' (expected)
Return values
boolfieldGreaterThan()
Check if a numeric field exceeds a threshold.
public
fieldGreaterThan(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 'field' (path) and 'value' (threshold)
Return values
boolfieldNotEmpty()
Check if a context field has a non-empty value.
public
fieldNotEmpty(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 'field' (path)
Return values
boolmemberHasPermission()
Check if a member has a specific permission.
public
memberHasPermission(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 'memberId' and 'permission'
Return values
boolresolveFieldPath()
Resolve a dot-separated field path from context.
public
static resolveFieldPath(array<string|int, mixed> $context, string $path) : mixed
Supports paths like 'entity.field_name', '$.entity.field_name', or simple field names.
Parameters
- $context : array<string|int, mixed>
-
The workflow context array
- $path : string
-
Dot-separated path to resolve
Return values
mixed —The resolved value or null if not found
compare()
Compare two values with a given operator.
private
static compare(mixed $left, string $operator, mixed $right) : bool
Parameters
- $left : mixed
-
Left operand
- $operator : string
-
Comparison operator
- $right : mixed
-
Right operand