Oihana PHP Arango

Field uses ConstantsTrait

Declarative markers of a field definition.

⚠️ When adding a scalar marker meant to survive the model → query normalization, remember to register it in FieldsTrait::NORMALIZED_MARKERS as well — an unregistered marker is silently stripped by normalizeFieldDefinition() and never reaches the query builders nor the permission gates.

Table of Contents

Constants

ALTERS  : string = 'alters'
Post-projection transformation pipeline applied to the field's value (see the `Alter` enum).
DEFAULT  : null = null
Default-value marker. `Field::DEFAULT === null`, so an option keyed here lands under the empty-string key.
EDGES  : string = 'edges'
Sub-edges map declared on a structural field (`Filter::WRAP` / `Filter::DOCUMENT`).
ELSE  : string = 'else'
Fallback projection emitted when a `Field::WHEN` condition is false (the ternary else branch).
FIELDS  : string = 'fields'
Sub-fields projection of a structural field (`Filter::DOCUMENT` / `Filter::MAP` / `Filter::WRAP`).
FILTER  : string = 'filter'
The field's filter — its projection type (see the `Filter` enum).
FORMAT  : string = 'format'
Format applied when rendering the field's value.
JOINS  : string = 'joins'
Sub-joins map declared on a structural field (`Filter::WRAP` / `Filter::DOCUMENT`).
NAME  : string = 'name'
Source document attribute the field projects (aliasing: the output key may differ from this name).
NULLABLE  : string = 'nullable'
Guards a fabricated projection behind the presence of its source, so an absent attribute yields `null` (or `Field::ELSE`) instead of a value built out of nothing: on a `Filter::DOCUMENT` an object of nulls (tested with `IS_OBJECT`), on a `Filter::BOOL` a `false` nobody stored and on a `Filter::NUMBER` a `0` nobody stored (both tested with `!= null`). Opt-in; composes with `Field::WHEN`.
PATH  : string = 'path'
Source path the field reads from — a URL route template for `Filter::URL`, and the mandatory fallback route when `Field::PATHS` is set.
PATHS  : string = 'paths'
Discriminant route map resolved at query time from a document attribute (`Filter::URL`); requires `Field::PATH` as the fallback.
PROPERTY  : string = 'property'
Nested parent property used as a source anchor — a join key, or the discriminant attribute for `Field::PATHS`.
QUOTED  : string = 'quoted'
Emit the field's value as a quoted AQL string literal.
RAW  : string = 'raw'
Project the referenced sub-document raw, with no sub-field projection.
REQUIRES  : string = 'requires'
Permission subject(s) gating the field's projection — OR over a list (see {@see isAuthorized()}).
SCOPE  : string = 'scope'
Where an edge property is read from when projecting it alongside the traversed vertex (see the `Scope` enum).
SELF_REQUIRES  : string = 'selfRequires'
Relation-scoped **OR alternative** to `Field::REQUIRES`, honoured **only** by {@see \oihana\arango\models\helpers\authorizeTargetFields()} when it re-applies a target model's read gate to a relation's own (`AQL::FIELDS`) projection.
SKINS  : string = 'skins'
Skin(s) that keep this field in the projection — a CSV string or a list of skin names.
UNIQUE  : string = 'unique'
Generated unique `LET` key for an edge / join / unique-name field (assigned during normalization).
WHEN  : string = 'when'
Condition guarding the field's projection (compiled to a ternary); pairs with `Field::ELSE`.
WHERE  : string = 'where'
Condition filtering the elements of a projected array (`Filter::MAP`), between the `FOR` and the `RETURN`.

Constants

ALTERS

Post-projection transformation pipeline applied to the field's value (see the `Alter` enum).

public string ALTERS = 'alters'

DEFAULT

Default-value marker. `Field::DEFAULT === null`, so an option keyed here lands under the empty-string key.

public null DEFAULT = null

EDGES

Sub-edges map declared on a structural field (`Filter::WRAP` / `Filter::DOCUMENT`).

public string EDGES = 'edges'

ELSE

Fallback projection emitted when a `Field::WHEN` condition is false (the ternary else branch).

public string ELSE = 'else'

FIELDS

Sub-fields projection of a structural field (`Filter::DOCUMENT` / `Filter::MAP` / `Filter::WRAP`).

public string FIELDS = 'fields'

FILTER

The field's filter — its projection type (see the `Filter` enum).

public string FILTER = 'filter'

FORMAT

Format applied when rendering the field's value.

public string FORMAT = 'format'

JOINS

Sub-joins map declared on a structural field (`Filter::WRAP` / `Filter::DOCUMENT`).

public string JOINS = 'joins'

NAME

Source document attribute the field projects (aliasing: the output key may differ from this name).

public string NAME = 'name'

NULLABLE

Guards a fabricated projection behind the presence of its source, so an absent attribute yields `null` (or `Field::ELSE`) instead of a value built out of nothing: on a `Filter::DOCUMENT` an object of nulls (tested with `IS_OBJECT`), on a `Filter::BOOL` a `false` nobody stored and on a `Filter::NUMBER` a `0` nobody stored (both tested with `!= null`). Opt-in; composes with `Field::WHEN`.

public string NULLABLE = 'nullable'

PATH

Source path the field reads from — a URL route template for `Filter::URL`, and the mandatory fallback route when `Field::PATHS` is set.

public string PATH = 'path'

PATHS

Discriminant route map resolved at query time from a document attribute (`Filter::URL`); requires `Field::PATH` as the fallback.

public string PATHS = 'paths'

PROPERTY

Nested parent property used as a source anchor — a join key, or the discriminant attribute for `Field::PATHS`.

public string PROPERTY = 'property'

QUOTED

Emit the field's value as a quoted AQL string literal.

public string QUOTED = 'quoted'

RAW

Project the referenced sub-document raw, with no sub-field projection.

public string RAW = 'raw'

REQUIRES

Permission subject(s) gating the field's projection — OR over a list (see {@see isAuthorized()}).

public string REQUIRES = 'requires'

SCOPE

Where an edge property is read from when projecting it alongside the traversed vertex (see the `Scope` enum).

public string SCOPE = 'scope'

SELF_REQUIRES

Relation-scoped **OR alternative** to `Field::REQUIRES`, honoured **only** by {@see \oihana\arango\models\helpers\authorizeTargetFields()} when it re-applies a target model's read gate to a relation's own (`AQL::FIELDS`) projection.

public string SELF_REQUIRES = 'selfRequires'

A field refused by the target model's Field::REQUIRES is kept when it declares Field::SELF_REQUIRES and the request authorizer grants at least one of its subjects — the relation is a legitimately broader context (e.g. reading a sub-field of a resource the caller owns). It never widens a model's direct reads: first-level projections do not pass through that helper, so the T6 guard stays intact everywhere else. An empty / malformed list is ignored (no override).

Tags
example
// Masked at the model, but readable through this relation with `people:self`.
'salary' =>
[
    Field::REQUIRES      => 'people:admin' , // model-level read gate
    Field::SELF_REQUIRES => 'people:self'  , // OR alternative, this relation only
]

SKINS

Skin(s) that keep this field in the projection — a CSV string or a list of skin names.

public string SKINS = 'skins'

UNIQUE

Generated unique `LET` key for an edge / join / unique-name field (assigned during normalization).

public string UNIQUE = 'unique'

WHEN

Condition guarding the field's projection (compiled to a ternary); pairs with `Field::ELSE`.

public string WHEN = 'when'

Valid on the default scalar projection, on Filter::DOCUMENT and on Filter::URL.

WHERE

Condition filtering the elements of a projected array (`Filter::MAP`), between the `FOR` and the `RETURN`.

public string WHERE = 'where'
On this page

Search results