|
@@ 400-404 (lines=5) @@
|
| 397 |
|
$sort = sprintf('ORDER BY `e`.`modification_date_gmt` %s', self::$_fetchSortDirection); |
| 398 |
|
|
| 399 |
|
// Handle sorting for System ID |
| 400 |
|
} elseif (self::$_fetchSortField === 'system:id' || self::$_fetchSortField === 'id') { |
| 401 |
|
$sort = sprintf('ORDER BY `e`.`id` %s', self::$_fetchSortDirection); |
| 402 |
|
|
| 403 |
|
// Handle when the sort field is an actual Field |
| 404 |
|
} elseif (self::$_fetchSortField && $field = FieldManager::fetch(self::$_fetchSortField)) { |
| 405 |
|
if ($field->isSortable()) { |
| 406 |
|
$field->buildSortingSQL($joins, $where, $sort, self::$_fetchSortDirection); |
| 407 |
|
} |
|
@@ 418-423 (lines=6) @@
|
| 415 |
|
if (!empty($field) && !$group) { |
| 416 |
|
$group = $field->requiresSQLGrouping(); |
| 417 |
|
} |
| 418 |
|
} else if (self::$_fetchSortField === 'system:id' || self::$_fetchSortField === 'id') { |
| 419 |
|
$sort = 'ORDER BY `e`.`id` ' . self::$_fetchSortDirection; |
| 420 |
|
|
| 421 |
|
} else { |
| 422 |
|
$sort = sprintf('ORDER BY `e`.`id` %s', self::$_fetchSortDirection); |
| 423 |
|
} |
| 424 |
|
|
| 425 |
|
if ($field && !$group) { |
| 426 |
|
$group = $field->requiresSQLGrouping(); |