function facetapi_sort_count in Facet API 7
Same name and namespace in other branches
- 6.3 plugins/facetapi/widget.inc \facetapi_sort_count()
- 6 facetapi.adapter.inc \facetapi_sort_count()
- 7.2 plugins/facetapi/widget.inc \facetapi_sort_count()
Sorts by facet count.
See also
uasort()
1 string reference to 'facetapi_sort_count'
- facetapi_facetapi_sort_info in ./
facetapi.facetapi.inc - Implements hook_facetapi_sort_info().
File
- plugins/
facetapi/ widget.inc, line 373 - Base widget plugin class and helper functions for facet sorting.
Code
function facetapi_sort_count(array $a, array $b) {
$a_count = isset($a['#count']) ? $a['#count'] : 0;
$b_count = isset($b['#count']) ? $b['#count'] : 0;
if ($a_count == $b_count) {
return 0;
}
return $a_count < $b_count ? -1 : 1;
}