1 select.inc | public SelectQuery::orderBy($field, $direction = 'ASC') |
Return value
Overrides SelectQueryInterface::orderBy
File
- core/
includes/ database/ select.inc, line 1784 - Contains classes and interfaces for Select queries.
Class
- SelectQuery
- Query builder for SELECT statements.
Code
public function orderBy($field, $direction = 'ASC') {
// Only allow ASC and DESC, default to ASC.
$direction = strtoupper($direction) == 'DESC' ? 'DESC' : 'ASC';
$this->order[$field] = $direction;
return $this;
}