yii\db\QueryInterface::orderBy PHP Method

orderBy() public method

Sets the ORDER BY part of the query.
See also: addOrderBy()
public orderBy ( string | array $columns )
$columns string | array the columns (and the directions) to be ordered by. Columns can be specified in either a string (e.g. "id ASC, name DESC") or an array (e.g. `['id' => SORT_ASC, 'name' => SORT_DESC]`). The method will automatically quote the column names unless a column contains some parenthesis (which means the column contains a DB expression).
    public function orderBy($columns);