public function Report::setSort in Forena Reports 7.5
Same name and namespace in other branches
- 8 src/Report.php \Drupal\forena\Report::setSort()
1 call to Report::setSort()
- Report::sort in src/
Report.php - Sort the current data context if it is an array.
File
- src/
Report.php, line 684 - Basic report provider. Controls the rendering of the report.
Class
Namespace
Drupal\forenaCode
public function setSort($sort, $compare_type = '') {
if (!$compare_type) {
if (defined(SORT_NATURAL)) {
$compare_type = SORT_NATURAL;
}
}
else {
if (is_string($compare_type)) {
if (defined($compare_type)) {
$compare_type = constant($compare_type);
}
else {
$compare_type = SORT_REGULAR;
}
}
}
$this->compareType = $compare_type;
// Assume an array of sort algorithms
if (is_array($sort)) {
$this->sortCriteria = $sort;
}
else {
$this->sortCriteria = (array) $sort;
}
}