system/core/classes/libraries/database/DTO.php
public function setOrderBy($field, $direction = null)
    {
        if (empty($field))
            return $this;

        if (count($order = explode(' ', $field)) == 2) {
            $field = $order[0];
            $direction = $order[1];
        }
        $this->orderBy[$field] = empty($direction) ? 'ASC' : $direction;
        return $this;
    }
public function setOrderBy($field, $direction = null)
    {
        if (empty($field))
            return $this;

        if (count($order = explode(' ', $field)) == 2) {
            $field = $order[0];
            $direction = $order[1];
        }
        $this->orderBy[$field] = empty($direction) ? 'ASC' : $direction;
        return $this;
    }
public function setOrderBy ( $ field , $ direction = null ) { if ( empty ( $ field ) ) return $ this ; if ( count ( $ order = explode ( ' ' , $ field ) ) == 2 ) { $ field = $ order [ 0 ] ; $ direction = $ order [ 1 ] ; } $ this -> orderBy [ $ field ] = empty ( $ direction ) ? 'ASC' : $ direction ; return $ this ; }
Sets the specified orderBy

@param string $field     The name of the field
@param string $direction The direction to sort. Can be ASC or DESC (default to ASC if not specified)

@return DTO $this
Sets the specified orderBy