EventFilter
EventFilter
Evaluates subscription filters against event data.
class EventFilterA filter is a map of dot-notation field paths to either a simple value that the field must equal, or an object of rules (is, not, like, in, nin) that must all pass. Filters arrive JSON-decoded, so the top level is an array and complex rules are \stdClass objects.
Used by the server to filter events sent to subscribed clients, and by agents to filter events forwarded to the tasks running under them.
Methods
normalise
Normalises a filter received in a packet payload.
public normalise(mixed $filter): ?arrayReturns: array
Only the top level is converted to an array so that complex per-field rules stay as objects.
Parameters
| Parameter | Type | Description |
|---|---|---|
$filter | mixed |
filtered
Tests whether event data should be filtered out.
public filtered(?array $filter, mixed $data): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$filter | array | the filter rules to test against |
$data | mixed | the event data |
resolveField
Resolves a dot-notation field path against event data.
private resolveField(array $path, mixed $data, ?bool $found): mixedReturns: mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | array | the field path, already split on '.' |
$data | mixed | the event data to search |
$found | bool | set to false if any part of the path does not exist |
Generated by Hazaar API Doc Generator on Thu, 22 Oct 2026 05:05:30 +0000