Oihana PHP Arango

resolveEdgeVertexScope.php

Table of Contents

Functions

resolveEdgeVertexScope()  : array{0: string|null, 1: string|null}
Compiles the **row scope** an edge definition declares over the vertices it traverses — the `[ $filter , $prune ]` pair, both already AQL predicate strings targeting `$vertexRef`, or `null` when nothing is declared.

Functions

resolveEdgeVertexScope()

Compiles the **row scope** an edge definition declares over the vertices it traverses — the `[ $filter , $prune ]` pair, both already AQL predicate strings targeting `$vertexRef`, or `null` when nothing is declared.

resolveEdgeVertexScope(array<string|int, mixed> $definition, string $vertexRef) : array{0: string|null, 1: string|null}

Two keys, answering two different questions:

  • AQL::WHERE — WHICH vertices the relation yields. Compiled from the Field::WHEN grammar, so a value may hold an aqlBindRef() and the retained set is decided at query time (a bind bound to [] retains nothing, an absent bind fails the query — never "no filter"). Emitted as a FILTER after the traversal.
  • AQL::PRUNE — whether the walk STOPS there. A FILTER only filters the traversal's output: on a ranged relation the walk still descends through a masked vertex, so its descendants keep being projected. true reuses the AQL::WHERE predicate negated ("hide it and its descent"); a condition of its own covers the case where stopping is not hiding. A condition is compiled rather than read as a boolean — anything written there is truthy, so it would otherwise be silently swapped for the negated AQL::WHERE. false means OFF, like an absent key, so a AQL::PRUNE => $flag toggle works both ways.

The two are emitted together and neither replaces the other: PRUNE stops the walk after visiting, so the vertex it stops on is still returned unless the FILTER removes it.

This lives in its own helper because the list and the count must read the declaration the same way — a count that scoped differently from the list would announce a number the rows contradict, which is the whole class of bug these keys exist to close.

Parameters
$definition : array<string|int, mixed>

The edge definition (reads AQL::WHERE / AQL::PRUNE).

$vertexRef : string

The AQL variable of the traversed vertex both predicates target.

Tags
throws
UnexpectedValueException

If AQL::PRUNE => true has no AQL::WHERE to negate.

UnsupportedOperationException

If a condition descriptor is malformed.

ValidationException

If a condition attribute name is unsafe.

since
1.0.0
author

Marc Alcaraz

Return values
array{0: string|null, 1: string|null}

The [ $filter , $prune ] predicates.

On this page

Search results