protected function DataProviderDbQuery::defaultSortInfo in RESTful 7.2
Defines default sort columns if none are provided via the request URL.
Return value
array Array keyed by the database column name, and the order ('ASC' or 'DESC') as value.
1 call to DataProviderDbQuery::defaultSortInfo()
- DataProviderDbQuery::queryForListSort in src/
Plugin/ resource/ DataProvider/ DataProviderDbQuery.php - Sort the query for list.
File
- src/
Plugin/ resource/ DataProvider/ DataProviderDbQuery.php, line 388 - Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderDbQuery.
Class
Namespace
Drupal\restful\Plugin\resource\DataProviderCode
protected function defaultSortInfo() {
$sorts = array();
foreach ($this
->getIdColumn() as $column) {
if (!$this->fieldDefinitions
->get($column)) {
// Sort by the first ID column that is a public field.
$sorts[$column] = 'ASC';
break;
}
}
return $sorts;
}