System:Preferences:getSort

From Aspen Documentation

Returns a sort preference

Since 1.0

Arguments

array getSort (string $location, [string $field = false], [string $default = 'id'], [string $dir = 'ASC'])

location
A unique key that identifies this sort with a specific location - a table, query, etc.
field
Sort by field name.
default
Default field name to sort by if preference not set.
dir
Sort by direction (ASC / DESC)

Returns

Returns an array.

Examples

Returning the sort preference using the following function:

 $this->APP->prefs->getSort('users:list');

Returns:

Array
(
    [sort_by] => id
    [sort_direction] => ASC
    [is_default] => 1
)