You are here

protected function ServicesViewsApiTestCase::helperCompareFunction in Services Views 7

Helper comparison function for orderResultSet().

File

tests/services_views.test, line 149

Class

ServicesViewsApiTestCase

Code

protected function helperCompareFunction($a, $b) {
  $value1 = $a[$this->sort_column];
  $value2 = $b[$this->sort_column];
  if ($value1 == $value2) {
    return 0;
  }
  return $this->sort_order * ($value1 < $value2 ? -1 : 1);
}