sortJoinVariable.php
Table of Contents
Functions
- sortJoinVariable() : string
- Generates the internal AQL 'SORT' clause for a join variable subquery.
Functions
sortJoinVariable()
Generates the internal AQL 'SORT' clause for a join variable subquery.
sortJoinVariable(array<string|int, mixed>|string|null $definition[, string $docRef = AQL::DOC_JOIN ][, string $defaultProperty = Schema::_KEY ]) : string
This helper interprets a flexible sort definition and constructs the appropriate
AQL 'SORT' expression. Unlike an edge relation, a join has a single document
variable ($docRef), so both the explicit sort property and the default fallback
target that same reference.
- If $definition is an array: looks for
AQL::SORT(property) andAQL::ORDER(ASC/DESC) and sorts by that property on the join document. - If $definition is a string (legacy): sorts by that string as the property on the join document in ASC order.
- If $definition is null (or
AQL::SORTis not set in the array): sorts by the $defaultProperty (e.g. '_key') on the join document in DESC order.
Parameters
- $definition : array<string|int, mixed>|string|null
-
The sort configuration. Typically the
$definitionarray from buildJoinVariable. - $docRef : string = AQL::DOC_JOIN
-
The internal AQL join-document variable reference (default: 'doc_join').
- $defaultProperty : string = Schema::_KEY
-
The fallback property to sort by (default: '_key').
Tags
Return values
string —The generated AQL 'SORT' clause.