public function sortBy($fields, $order = null, array $parameters = [])
    {
        $fields = is_array($fields) ? $fields : [$fields];

        foreach ($fields as $field) {
            $sort = new FieldSort($field, $order, $parameters);

            $this->query->addSort($sort);
        }

        return $this;
    }
public function sortBy($fields, $order = null, array $parameters = [])
    {
        $fields = is_array($fields) ? $fields : [$fields];

        foreach ($fields as $field) {
            $sort = new FieldSort($field, $order, $parameters);

            $this->query->addSort($sort);
        }

        return $this;
    }
public function sortBy ( $ fields , $ order = null , array $ parameters = [ ] ) { $ fields = is_array ( $ fields ) ? $ fields : [ $ fields ] ; foreach ( $ fields as $ field ) { $ sort = new FieldSort ( $ field , $ order , $ parameters ) ; $ this -> query -> addSort ( $ sort ) ; } return $ this ; }
Set the query sort values values.

@param string|array $fields
@param null         $order
@param array        $parameters

@return $this
Set the query sort values values .