function Select::orderBy
Same name in this branch
- 8.9.x core/lib/Drupal/Core/Database/Driver/pgsql/Select.php \Drupal\Core\Database\Driver\pgsql\Select::orderBy()
Same name in other branches
- 9 core/modules/pgsql/src/Driver/Database/pgsql/Select.php \Drupal\pgsql\Driver\Database\pgsql\Select::orderBy()
- 9 core/lib/Drupal/Core/Database/Query/Select.php \Drupal\Core\Database\Query\Select::orderBy()
- 10 core/modules/pgsql/src/Driver/Database/pgsql/Select.php \Drupal\pgsql\Driver\Database\pgsql\Select::orderBy()
- 10 core/lib/Drupal/Core/Database/Query/Select.php \Drupal\Core\Database\Query\Select::orderBy()
- 11.x core/modules/pgsql/src/Driver/Database/pgsql/Select.php \Drupal\pgsql\Driver\Database\pgsql\Select::orderBy()
- 11.x core/lib/Drupal/Core/Database/Query/Select.php \Drupal\Core\Database\Query\Select::orderBy()
Overrides SelectInterface::orderBy
1 call to Select::orderBy()
- Select::orderRandom in core/
lib/ Drupal/ Core/ Database/ Query/ Select.php - Orders the result set by a random value.
1 method overrides Select::orderBy()
- Select::orderBy in core/
lib/ Drupal/ Core/ Database/ Driver/ pgsql/ Select.php - Overrides SelectQuery::orderBy().
File
-
core/
lib/ Drupal/ Core/ Database/ Query/ Select.php, line 660
Class
- Select
- Query builder for SELECT statements.
Namespace
Drupal\Core\Database\QueryCode
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.