aqlAsc.php
Table of Contents
Functions
- aqlAsc() : string
- Builds an ascending AQL `SORT` expression for the given attribute key.
Functions
aqlAsc()
Builds an ascending AQL `SORT` expression for the given attribute key.
aqlAsc(string $key[, string|null $prefix = null ]) : string
This helper simplifies the creation of SORT clauses by combining the
provided key (and optional prefix) with the ASC order keyword.
The resulting string can be directly injected into an AQL statement or
composed with other expressions (e.g., using aqlSort()).
Example: basic usage
echo aqlAsc('age');
// → "age ASC"
Example: with prefix
echo aqlAsc('name', 'u');
// → "u.name ASC"
Example: combined in a SORT clause
echo 'SORT ' . aqlAsc('score', 'player');
// → "SORT player.score ASC"
Parameters
- $key : string
-
The attribute name to sort by (e.g.,
'age','createdAt','score'). - $prefix : string|null = null
-
Optional variable or collection prefix (e.g.,
'u'for"u.age").
Tags
Return values
string —The formatted ascending sort expression, e.g. "doc.name ASC".