buildBetweenClauses.php
Table of Contents
Functions
- buildBetweenClauses() : string
- Assemble the AQL clauses of a `between` (range) comparison.
Functions
buildBetweenClauses()
Assemble the AQL clauses of a `between` (range) comparison.
buildBetweenClauses(string $left, string|null $min, string|null $max) : string
Given an already-resolved left operand and the (already-resolved) lower/upper bound expressions, builds the inclusive range test:
(left >= min && left <= max) // both bounds
left >= min // upper omitted (null)
left <= max // lower omitted (null)
Bound omission is the CALLER's policy: pass null for a bound to drop its
clause. Number/string filters drop the omitted side (one-sided range); date
filters resolve an omitted bound to "now" upstream, so they never pass null.
Returns an empty string when both bounds are null.
Parameters
- $left : string
-
The left operand (e.g.
doc.price,DATE_DAY(doc.d)). - $min : string|null
-
The lower-bound AQL expression, or null to omit it.
- $max : string|null
-
The upper-bound AQL expression, or null to omit it.
Tags
Return values
string —The combined range clause (parenthesized when both bounds are present).