ConditionalValue
in package
FinalYes
The value a conditional parameter resolves to in a row context: a condition map selects the value of its first matching condition, else its `true` default, else null (a condition that cannot be evaluated does not match); a ternary resolves to its branch value and stays the literal string when it cannot be evaluated; a valid condition expression resolves to its value, or false when it cannot be evaluated; any other string, and any other value, is a literal.
Table of Contents
Methods
Methods
resolve()
public
static resolve(mixed $value, array<string|int, mixed>|stdClass $data, array<int, string> $path[, array<int, int> $rowKeys = [] ]) : mixed
Parameters
- $value : mixed
- $data : array<string|int, mixed>|stdClass
- $path : array<int, string>
-
the row context, row keys included
- $rowKeys : array<int, int> = []
-
positions of the row keys in $path
matches()
private
static matches(string $condition, array<string|int, mixed>|stdClass $data, array<int, string> $path, array<int, int> $rowKeys) : bool
Parameters
- $condition : string
- $data : array<string|int, mixed>|stdClass
- $path : array<int, string>
- $rowKeys : array<int, int>
Return values
boolselect()
private
static select(array<string|int, mixed> $map, array<string|int, mixed>|stdClass $data, array<int, string> $path, array<int, int> $rowKeys) : mixed
Parameters
- $map : array<string|int, mixed>
- $data : array<string|int, mixed>|stdClass
- $path : array<int, string>
- $rowKeys : array<int, int>