GroupOperator
MMO\core\helpers · 1 symbol · generated 30 Sep 2026
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
const And = MMO\core\helpers\GroupOperator::Andconst Nor = MMO\core\helpers\GroupOperator::Norconst Or = MMO\core\helpers\GroupOperator::OrProperties2
readonly string $name- Type
- string
readonly string $value- Type
- string
Methods5
static function cases(): arraystatic function from(string|int $value): staticstatic function FromString(string $value, bool $throw = true): ?self| $value | string | a $xxx mongo-style name, or a shorthand alias (e.g. '&', '|', '!') |
| $throw = true | bool | if false, return null instead of throwing for an unrecognized $value |
| returns | null | self | |
GroupOperator::FromString('|'); // GroupOperator::Or
function test(callable $test, ...$args): bool| $test | callable | function(mixed $member): bool -- called on each of $args in turn |
| ...$args | | |
| returns | bool | NOTE: 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
static function tryFrom(string|int $value): ?static