AqlLiteral
Read onlyYes
Marker value for AQL fragments that must be inlined verbatim into a query string instead of being bound as parameters.
Use this for AQL keywords / function names that cannot be parameterised
(ASC, DESC, function identifiers, attribute names received from a
server-side whitelist, …). The value MUST come from a trusted source —
never from raw user input — since it bypasses the safe binding layer
and is interpolated as-is into the final query string.
Example:
$direction = $userInput === 'desc' ? 'DESC' : 'ASC' ; // whitelisted upstream
$cursor = $db->query
(
aql( 'FOR u IN users SORT u.name ? RETURN u' , aqlLiteral( $direction ) )
) ;
Tags
Table of Contents
Properties
- $value : string
Methods
- __construct() : mixed
- __toString() : string
- Returns the literal value, so a `AqlLiteral` may be safely interpolated in a string context (e.g. within a `sprintf()` call).
Properties
$value
public
string
$value
Methods
__construct()
public
__construct(string $value) : mixed
Parameters
- $value : string
-
Raw AQL fragment to inline verbatim into a query.
__toString()
Returns the literal value, so a `AqlLiteral` may be safely interpolated in a string context (e.g. within a `sprintf()` call).
public
__toString() : string