views_xml_backend_handler_sort_numeric.inc in Views XML Backend 6
Same filename and directory in other branches
Numeric sort handler for views_xml_backend.
File
handlers/views_xml_backend_handler_sort_numeric.incView source
<?php
/**
* @file
* Numeric sort handler for views_xml_backend.
*/
class views_xml_backend_handler_sort_numeric extends views_xml_backend_handler_sort {
function sort_asc($a, $b) {
$a_value = isset($a->{$this->field}) ? $a->{$this->field} : '';
$b_value = isset($b->{$this->field}) ? $b->{$this->field} : '';
return $a_value - $b_value;
}
function sort_desc($a, $b) {
$a_value = isset($a->{$this->field}) ? $a->{$this->field} : '';
$b_value = isset($b->{$this->field}) ? $b->{$this->field} : '';
return -($a_value - $b_value);
}
}
Classes
Name | Description |
---|---|
views_xml_backend_handler_sort_numeric | @file Numeric sort handler for views_xml_backend. |