public function ViewsJsonQuery::sortDesc in Views Json Source 8
Same name and namespace in other branches
- 1.x src/Plugin/views/query/ViewsJsonQuery.php \Drupal\views_json_source\Plugin\views\query\ViewsJsonQuery::sortDesc()
Sort Descending.
1 call to ViewsJsonQuery::sortDesc()
- ViewsJsonQuery::sort in src/
Plugin/ views/ query/ ViewsJsonQuery.php - Sort.
File
- src/
Plugin/ views/ query/ ViewsJsonQuery.php, line 573
Class
- ViewsJsonQuery
- Base query handler for views_json_source.
Namespace
Drupal\views_json_source\Plugin\views\queryCode
public function sortDesc($key) {
return function ($a, $b) use ($key) {
$a_value = $a[$key] ?? '';
$b_value = $b[$key] ?? '';
return -strnatcasecmp($a_value, $b_value);
};
}