public function getSorts()
    {
        $sortInput = $this->request->input($this->sortName, '');

        $sortFields = $this->collection->make(
            is_array($sortInput) ? $sortInput :
                explode($this->sortFieldsSeparator, $sortInput));

        $sorts = $this->collection->make();

        $sortFields->each(function ($field) use ($sorts) {
            $s = new Sort();
            $order = 'ASC';

            if (starts_with($field, $this->sortDescSign)) {
                $order = 'DESC';
                $field = mb_substr($field, mb_strlen($this->sortDescSign));
            }

            if ($field = trim($field)) {
                $s->setField($field);
                $s->setOrder($order);
                $sorts->put($field, $s);
            }
        });

        return $sorts->values();
    }
public function getSorts()
    {
        $sortInput = $this->request->input($this->sortName, '');

        $sortFields = $this->collection->make(
            is_array($sortInput) ? $sortInput :
                explode($this->sortFieldsSeparator, $sortInput));

        $sorts = $this->collection->make();

        $sortFields->each(function ($field) use ($sorts) {
            $s = new Sort();
            $order = 'ASC';

            if (starts_with($field, $this->sortDescSign)) {
                $order = 'DESC';
                $field = mb_substr($field, mb_strlen($this->sortDescSign));
            }

            if ($field = trim($field)) {
                $s->setField($field);
                $s->setOrder($order);
                $sorts->put($field, $s);
            }
        });

        return $sorts->values();
    }
public function getSorts ( ) { $ sortInput = $ this -> request -> input ( $ this -> sortName , '' ) ; $ sortFields = $ this -> collection -> make ( is_array ( $ sortInput ) ? $ sortInput : explode ( $ this -> sortFieldsSeparator , $ sortInput ) ) ; $ sorts = $ this -> collection -> make ( ) ; $ sortFields -> each ( function ( $ field ) use ( $ sorts ) { $ s = new Sort ( ) ; $ order = 'ASC' ; if ( starts_with ( $ field , $ this -> sortDescSign ) ) { $ order = 'DESC' ; $ field = mb_substr ( $ field , mb_strlen ( $ this -> sortDescSign ) ) ; } if ( $ field = trim ( $ field ) ) { $ s -> setField ( $ field ) ; $ s -> setOrder ( $ order ) ; $ sorts -> put ( $ field , $ s ) ; } } ) ; return $ sorts -> values ( ) ; }
Get parameters for sorting.

@return Collection
Get parameters for sorting .