You are here

public function ViewsEFFieldsetComparator::sort in Views Exposed Form Fieldset 7.2

Sort callback.

File

includes/comparator.inc, line 59

Class

ViewsEFFieldsetComparator

Code

public function sort(array $array_a, array $array_b) {
  $a = $array_a[$this->key];
  $b = $array_b[$this->key];
  if ($a === $b) {
    return 0;
  }
  if ($a === NULL && $this->nullA !== NULL) {
    return $this->nullA;
  }
  if ($b === NULL && $this->nullB !== NULL) {
    return $this->nullB;
  }
  if ($a == $b) {
    return 0;
  }
  return $a < $b ? -1 : 1;
}