final public function replaceSort($columnName, $ascending = true)
    {
        if (!is_array($columnName)) {
            $sorts = [$columnName => $ascending];
        } else {
            $sorts = $columnName;
        }

        $this->sorts = [];

        foreach ($sorts as $index => $value) {
            $this->addSort($index, $value);
        }

        return $this;
    }
final public function replaceSort($columnName, $ascending = true)
    {
        if (!is_array($columnName)) {
            $sorts = [$columnName => $ascending];
        } else {
            $sorts = $columnName;
        }

        $this->sorts = [];

        foreach ($sorts as $index => $value) {
            $this->addSort($index, $value);
        }

        return $this;
    }
final public function replaceSort ( $ columnName , $ ascending = true ) { if ( ! is_array ( $ columnName ) ) { $ sorts = [ $ columnName => $ ascending ] ; } else { $ sorts = $ columnName ; } $ this -> sorts = [ ] ; foreach ( $ sorts as $ index => $ value ) { $ this -> addSort ( $ index , $ value ) ; } return $ this ; }
Removes current sorts and replaces with another.

Can take an array of sorts instead of a single sort in which case it should be an associative array
of column name => true/false values (true for ascending false for descending)

@param $columnName
@param bool $ascending
@return $this
@throws FilterNotSupportedException
Removes current sorts and replaces with another .