protected function parseSort($sort)
    {
        $type = substr($sort, 0, 1);
        $key = substr($sort, 1);

        switch ($type) {
            case '+': $type = Sort::TYPE_ASC; break;
            case '-': $type = Sort::TYPE_DESC; break;
            default:
                throw new NoSuchSortException();
        }

        return new Sort($type, $key);
    }
protected function parseSort($sort)
    {
        $type = substr($sort, 0, 1);
        $key = substr($sort, 1);

        switch ($type) {
            case '+': $type = Sort::TYPE_ASC; break;
            case '-': $type = Sort::TYPE_DESC; break;
            default:
                throw new NoSuchSortException();
        }

        return new Sort($type, $key);
    }
protected function parseSort ( $ sort ) { $ type = substr ( $ sort , 0 , 1 ) ; $ key = substr ( $ sort , 1 ) ; switch ( $ type ) { case '+' : $ type = Sort :: TYPE_ASC ; break ; case '-' : $ type = Sort :: TYPE_DESC ; break ; default : throw new NoSuchSortException ( ) ; } return new Sort ( $ type , $ key ) ; }
Parse a single sort from a raw query string

@param $sort

@return Sort

@throws NoSuchSortException
Parse a single sort from a raw query string