Oihana PHP Arango

resolveWhenElse.php

Table of Contents

Functions

resolveWhenElse()  : string
Resolve the `Field::ELSE` branch of a conditional field into an AQL expression.

Functions

resolveWhenElse()

Resolve the `Field::ELSE` branch of a conditional field into an AQL expression.

resolveWhenElse([mixed $else = null ][, string $doc = AQL::DOC ]) : string

Two forms:

  • Attribute reference[ Field::PROPERTY => '<attr>' ]doc.<attr> (validated by assertAttributeName()), so the fallback can mirror another document attribute.
  • Literal — anything else (a scalar, an array of scalars, or null — the default) is inlined via aqlValue().
Parameters
$else : mixed = null

The Field::ELSE descriptor (default null).

$doc : string = AQL::DOC

The document reference (default: AQL::DOC).

Tags
throws
UnsupportedOperationException
ValidationException

If the referenced attribute name is unsafe.

since
1.3.0
author

Marc Alcaraz

Return values
string

The AQL expression for the else branch (null, 0, "N/A", doc.basePrice, …).

On this page

Search results