aqlExpression.php
Table of Contents
Functions
- aqlExpression() : string|null
- Converts a value into an AQL expression.
Functions
aqlExpression()
Converts a value into an AQL expression.
aqlExpression(object|string|array<string|int, mixed>|null $value) : string|null
Accepts either:
- A string representing a raw AQL expression, returned as-is.
- An array or object representing key-value pairs, converted into an AQL document object using aqlDocument().
null, which results in anullreturn value.
Internally, this function delegates to aqlDocument() when $value
is an array or object, and otherwise returns the raw string.
Examples:
echo aqlExpression( "FOR u IN users RETURN u" ) ; // "FOR u IN users RETURN u"
echo aqlExpression( ['name' => 'John', 'age' => 30] ) ; // "{name:'John',age:30}"
echo aqlExpression( [['status', 'active']] ) ; // "{status:'active'}"
echo aqlExpression( null ) ; // null
Parameters
- $value : object|string|array<string|int, mixed>|null
-
The value to convert into an AQL expression.
Tags
Return values
string|null —Returns the raw AQL expression or a converted document string,
or null if the input value is null.