You are here

function facetapi_sort_indexed in Facet API 6.3

Same name and namespace in other branches
  1. 6 facetapi.adapter.inc \facetapi_sort_indexed()
  2. 7.2 plugins/facetapi/widget.inc \facetapi_sort_indexed()
  3. 7 plugins/facetapi/widget.inc \facetapi_sort_indexed()

Sorts by raw indexed value.

1 string reference to 'facetapi_sort_indexed'
facetapi_facetapi_sort_info in ./facetapi.facetapi.inc
Implements hook_facetapi_sort_info().

File

plugins/facetapi/widget.inc, line 281
Abstract widget plugin class.

Code

function facetapi_sort_indexed(array $a, array $b) {
  $a_value = isset($a['#indexed_value']) ? $a['#indexed_value'] : '';
  $b_value = isset($b['#indexed_value']) ? $b['#indexed_value'] : '';
  if ($a_value == $b_value) {
    return 0;
  }
  return $a_value < $b_value ? -1 : 1;
}