GroupOperator
MMO\core\helpers · 1 symbole · générée le 27 Oct 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- Espace de noms
MMO\core\helpers
Constantes3
const And = MMO\core\helpers\GroupOperator::Andconst Nor = MMO\core\helpers\GroupOperator::Norconst Or = MMO\core\helpers\GroupOperator::OrPropriétés2
readonly string $name- Type
- string
readonly string $value- Type
- string
Méthodes5
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 |
| retourne | 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 | | |
| retourne | 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