public function orderBy($field, $order = 'ASC')
    {
        if(is_string($field) && trim($field) != '') {
            $field = trim($field);
            $field = ltrim($field, 'ORDER BY ');
            $this->order = ' ORDER BY `'.$field.'`'.(($order == 'DESC') ? ' DESC' : ' ASC');
        }
        return $this;
    }
public function orderBy($field, $order = 'ASC')
    {
        if(is_string($field) && trim($field) != '') {
            $field = trim($field);
            $field = ltrim($field, 'ORDER BY ');
            $this->order = ' ORDER BY `'.$field.'`'.(($order == 'DESC') ? ' DESC' : ' ASC');
        }
        return $this;
    }
public function orderBy ( $ field , $ order = 'ASC' ) { if ( is_string ( $ field ) && trim ( $ field ) != '' ) { $ field = trim ( $ field ) ; $ field = ltrim ( $ field , 'ORDER BY ' ) ; $ this -> order = ' ORDER BY `' . $ field . '`' . ( ( $ order == 'DESC' ) ? ' DESC' : ' ASC' ) ; } return $ this ; }
Create ORDER BY clause

@param   string  $field
@param   string  $order
@return  $this
Create ORDER BY clause