sortEdgeVariable.php
Table of Contents
Functions
- sortEdgeVariable() : string
- Generates the internal AQL 'SORT' clause for an edge variable subquery.
Functions
sortEdgeVariable()
Generates the internal AQL 'SORT' clause for an edge variable subquery.
sortEdgeVariable(array<string|int, mixed>|string|null $definition[, string $vertexRef = AQL::VERTEX ][, string $edgeRef = AQL::EDGE ][, string $defaultProperty = Schema::CREATED ]) : string
This helper method interprets a flexible sort definition and constructs the appropriate AQL 'SORT' expression.
- If $definition is an array: Looks for
AQL::SORT(property) andAQL::ORDER(ASC/DESC) and sorts by the vertex property. - If $definition is a string (legacy): Sorts by that string as the property on the vertex in ASC order.
- If $definition is null (or
AQL::SORTis not set in the array): Sorts by the $defaultProperty (e.g., 'created') on the edge in DESC order.
Parameters
- $definition : array<string|int, mixed>|string|null
-
The sort configuration. Typically the
$definitionarray from getEdgeVariable. - $vertexRef : string = AQL::VERTEX
-
The internal AQL vertex variable reference.
- $edgeRef : string = AQL::EDGE
-
The internal AQL edge variable reference.
- $defaultProperty : string = Schema::CREATED
-
The fallback property to sort by (default: 'created').
Tags
Return values
string —The generated AQL 'SORT' clause (e.g., "SORT v_myVar_collectionName.name ASC").