sortRelationVariable.php
Table of Contents
Functions
- sortRelationVariable() : string
- Generates the internal AQL 'SORT' clause for a relation sub-query (edge or join).
Functions
sortRelationVariable()
Generates the internal AQL 'SORT' clause for a relation sub-query (edge or join).
sortRelationVariable(array<string|int, mixed>|string|null $definition, string $sortRef, string $defaultRef[, string $defaultProperty = Schema::CREATED ]) : string
This helper interprets a flexible sort definition and constructs the appropriate AQL 'SORT' expression, shared by sortEdgeVariable() and sortJoinVariable(). The only thing those two wrappers customize is which variable reference carries the sort property and which one carries the default fallback property:
- An explicit sort property (string definition, or
AQL::SORTin an array) is sorted on$sortRef(the vertex for an edge, the join document for a join). - The fallback (no
AQL::SORTprovided) sorts by$defaultPropertyon$defaultRefin DESC order (the edge for an edge relation, the same join document for a join).
Parameters
- $definition : array<string|int, mixed>|string|null
-
The sort configuration (a
$definitionarray, a legacy string, or null). - $sortRef : string
-
The AQL variable reference carrying an explicit sort property.
- $defaultRef : string
-
The AQL variable reference carrying the fallback default property.
- $defaultProperty : string = Schema::CREATED
-
The fallback property to sort by (default: 'created').
Tags
Return values
string —The generated AQL 'SORT' clause.