function SelectQuery::orderBy

Overrides SelectQueryInterface::orderBy

2 calls to SelectQuery::orderBy()
SelectQuery::orderRandom in includes/database/select.inc
Orders the result set by a random value.
SelectQuery_pgsql::orderBy in includes/database/pgsql/select.inc
Overrides SelectQuery::orderBy().
1 method overrides SelectQuery::orderBy()
SelectQuery_pgsql::orderBy in includes/database/pgsql/select.inc
Overrides SelectQuery::orderBy().

File

includes/database/select.inc, line 1433

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.