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