protected function ViewTestBase::helperCompareFunction in Views (for Drupal 7) 8.3
Helper comparison function for orderResultSet().
File
- lib/
Drupal/ views/ Tests/ ViewTestBase.php, line 155 - Definition of Drupal\views\Tests\ViewTestBase.
Class
- ViewTestBase
- Abstract class for views testing.
Namespace
Drupal\views\TestsCode
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);
}