function views_customfield_sorter::views_customfield_sorter in Views Custom Field 6
File
- includes/
views_customfield_handler_field_phpcode.inc, line 218 - Contains the 'customfield' phpcode field handler.
Class
Code
function views_customfield_sorter($sortable, $sort_order, $field_alias) {
$this->factor = strtoupper($sort_order) == 'ASC' ? 1 : -1;
$functions = array(
VIEWS_CUSTOMFIELD_SORTABLE_NUMERIC => create_function('$a,$b', 'return $a-$b;'),
VIEWS_CUSTOMFIELD_SORTABLE_ALPHA => 'strcmp',
VIEWS_CUSTOMFIELD_SORTABLE_ALPHA_NOCASE => 'strcasecmp',
VIEWS_CUSTOMFIELD_SORTABLE_NAT => 'strnatcmp',
VIEWS_CUSTOMFIELD_SORTABLE_NAT_NOCASE => 'strnatcasecmp',
);
$this->function = $functions[$sortable];
$this->field_alias = $field_alias;
}