/** * A usort callback to sort by methods on records * * @param fActiveRecord $a The first record to compare * @param fActiveRecord $b The second record to compare * @return integer < 0 if `$a` is less than `$b`, 0 if `$a` = `$b`, > 0 if `$a` is greater than `$b` */ private function sortCallback($a, $b) { if ($this->sort_direction == 'asc') { return fUTF8::inatcmp($a->{$this->sort_method}(), $b->{$this->sort_method}()); } return fUTF8::inatcmp($b->{$this->sort_method}(), $a->{$this->sort_method}()); }