Scope uses ConstantsTrait
The projection scope used by {@see Field::SCOPE} inside an edge sub-query.
When a field of an edge definition (AQL::EDGES) is projected, it is, by
default, read from the target vertex of the traversal. Setting
Field::SCOPE => Scope::EDGE instead reads it from the edge itself,
so the relationship metadata (e.g. created, weight, role, order)
can be hoisted into the returned object alongside the vertex fields.
The constant values are intentionally identical to AQL::VERTEX and AQL::EDGE, so both forms are interchangeable in a definition:
use oihana\arango\db\enums\AQL ;
use oihana\arango\enums\Scope ;
Field::SCOPE => Scope::EDGE // explicit and self-documenting
Field::SCOPE => AQL::EDGE // avoids an extra `use` when AQL is already imported
Tags
Table of Contents
Constants
- EDGE : string = 'edge'
- Projects the field from the traversal edge (the relationship metadata).
- VERTEX : string = 'vertex'
- Projects the field from the target vertex (the default).
Constants
EDGE
Projects the field from the traversal edge (the relationship metadata).
public
string
EDGE
= 'edge'
VERTEX
Projects the field from the target vertex (the default).
public
string
VERTEX
= 'vertex'