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::ELSEdescriptor (defaultnull). - $doc : string = AQL::DOC
-
The document reference (default:
AQL::DOC).
Tags
Return values
string —The AQL expression for the else branch (null, 0, "N/A", doc.basePrice, …).