Index

GroupOperator

MMO\core\helpers · 1 symbol · generated 30 Sep 2026

enum

GroupOperator

Filter.php:684

How a FilterGroup's members combine: AND (all must match), OR (any must match), NOR (none may match).

enum MMO\core\helpers\GroupOperator: string
Namespace
MMO\core\helpers

Constants3

And

const And = MMO\core\helpers\GroupOperator::And

Nor

const Nor = MMO\core\helpers\GroupOperator::Nor

Or

const Or = MMO\core\helpers\GroupOperator::Or

Properties2

name

readonly
readonly string $name
Type
string

value

readonly
readonly string $value
Type
string

Methods5

cases()

static
static function cases(): array
returnsarray

from($value)

static
static function from(string|int $value): static
$valuestring | int
returnsstatic

FromString($value, $throw)

staticFilter.php:695
static function FromString(string $value, bool $throw = true): ?self
$valuestringa $xxx mongo-style name, or a shorthand alias (e.g. '&', '|', '!')
$throw = trueboolif false, return null instead of throwing for an unrecognized $value
returnsnull | self
GroupOperator::FromString('|'); // GroupOperator::Or

test($test, $args)

Filter.php:711
function test(callable $test, ...$args): bool
$testcallablefunction(mixed $member): bool -- called on each of $args in turn
...$args
returnsboolNOTE: an empty $args list always returns true for every operator (AND/OR/NOR alike): no members means no constraint, not "nothing can match"
GroupOperator::Or->test(fn($v) => $v > 0, -1, 2, -3); // true: at least one member (2) passes

tryFrom($value)

static
static function tryFrom(string|int $value): ?static
$valuestring | int
returnsnull | static