buildVariables.php
Table of Contents
Functions
- buildVariables() : void
- Builds all fields variables definitions (edges, joins, etc.).
Functions
buildVariables()
Builds all fields variables definitions (edges, joins, etc.).
buildVariables([array<string|int, mixed> &$variables = [] ][, array<string|int, mixed> $fields = [] ][, array<string|int, mixed>|null $edges = [] ][, array<string|int, mixed>|null $joins = [] ][, ContainerInterface|null $container = null ][, string $docRef = AQL::DOC ][, array<string|int, mixed> $init = [] ]) : void
Permission gating happens at TWO composable levels — either one can drop the relation (logical AND across levels, logical OR inside a declared subjects list):
- Field-level — the FIELDS entry (the relation marker) declares
Field::REQUIRES: gates this projection of the relation in this parent. Combined with the symmetric drop inaqlFields(), the field disappears from both the AQL projection and the response — no key in the JSON, no orphan reference in the AQL. - Definition-level — the edge/join definition itself declares
AQL::REQUIRES: gates the relation wherever the definition is used. The symmetric field-side drop is handled upstream by authorizeRelationFields() at every point where a prepared fields array meets its registries.
The check is uniform: edges, joins, and edge-counts all share the
same gating contract. A Filter::EDGES_COUNT companion is gated
exactly the same way as the others — it is simply not gated by
default because no Field::REQUIRES is declared on it. To gate
the count, declare Field::REQUIRES on the count entry itself
(or AQL::REQUIRES on the shared definition to gate every usage).
Parameters
- $variables : array<string|int, mixed> = []
- $fields : array<string|int, mixed> = []
- $edges : array<string|int, mixed>|null = []
- $joins : array<string|int, mixed>|null = []
- $container : ContainerInterface|null = null
- $docRef : string = AQL::DOC
- $init : array<string|int, mixed> = []