collectWhenAttributes.php
Table of Contents
Functions
- collectWhenAttributes() : array<int, string>
- Collects the document attribute names **read** by a {@see \oihana\arango\enums\Field::WHEN} (or {@see \oihana\arango\enums\Field::WHERE}) condition, mirroring the grammar compiled by {@see buildWhenCondition()} — a truthiness string, an explicit leaf (list `[ attr, op, val ]` or associative `[ FilterParam::KEY => …, … ]`), and the `and` / `or` / `not` / implicit-AND groups.
Functions
collectWhenAttributes()
Collects the document attribute names **read** by a {@see \oihana\arango\enums\Field::WHEN} (or {@see \oihana\arango\enums\Field::WHERE}) condition, mirroring the grammar compiled by {@see buildWhenCondition()} — a truthiness string, an explicit leaf (list `[ attr, op, val ]` or associative `[ FilterParam::KEY => …, … ]`), and the `and` / `or` / `not` / implicit-AND groups.
collectWhenAttributes(mixed $when) : array<int, string>
Only the left (attribute) side of each leaf is returned — the compared value is a bound literal and reads nothing. A left side that is not a plain attribute name (an AqlBindReference, a runtime bind) is skipped: it references no document field, so there is nothing to gate.
Used by conditionReadsDeniedField() to enforce that a conditional projection cannot read a field the caller may not read (no inference oracle through a condition).
Parameters
- $when : mixed
-
The
Field::WHEN/Field::WHEREpayload.
Tags
Return values
array<int, string> —The attribute names read by the condition (possibly empty).