private function extractSorting(array $params)
    {
        if (false === $this->issetNotEmpty(self::PARAM_SORTING, $params)) {
            return $this;
        }
        $sort = explode(',', $params[self::PARAM_SORTING]);
        $this->sorting = [];
        foreach ($sort as $field) {
            $direction = 1;
            if (0 === strpos($field, '-')) {
                $direction = -1;
                $field = str_replace('-', '', $field);
            }
            $this->sorting[$field] = $direction;
        }
        return $this;
    }
private function extractSorting(array $params)
    {
        if (false === $this->issetNotEmpty(self::PARAM_SORTING, $params)) {
            return $this;
        }
        $sort = explode(',', $params[self::PARAM_SORTING]);
        $this->sorting = [];
        foreach ($sort as $field) {
            $direction = 1;
            if (0 === strpos($field, '-')) {
                $direction = -1;
                $field = str_replace('-', '', $field);
            }
            $this->sorting[$field] = $direction;
        }
        return $this;
    }
private function extractSorting ( array $ params ) { if ( false === $ this -> issetNotEmpty ( self :: PARAM_SORTING , $ params ) ) { return $ this ; } $ sort = explode ( ',' , $ params [ self :: PARAM_SORTING ] ) ; $ this -> sorting = [ ] ; foreach ( $ sort as $ field ) { $ direction = 1 ; if ( 0 === strpos ( $ field , '-' ) ) { $ direction = - 1 ; $ field = str_replace ( '-' , '' , $ field ) ; } $ this -> sorting [ $ field ] = $ direction ; } return $ this ; }
Extracts sorting criteria from an array of query params.

@param   array   $params
@return  self
Extracts sorting criteria from an array of query params .