public function defaultSortingStrategy(string $strategy): ModelList
    {
        if (is_string($this->main['default_sort'])) {
            $this->main['default_sort'] = [ $this->main['default_sort'] ];
            $this->main['default_sort'][] = $strategy;

            return $this;
        }

        $this->main['default_sort'] = $strategy;

        return $this;
    }
public function defaultSortingStrategy(string $strategy): ModelList
    {
        if (is_string($this->main['default_sort'])) {
            $this->main['default_sort'] = [ $this->main['default_sort'] ];
            $this->main['default_sort'][] = $strategy;

            return $this;
        }

        $this->main['default_sort'] = $strategy;

        return $this;
    }
public function defaultSortingStrategy ( string $ strategy ) : ModelList { if ( is_string ( $ this -> main [ 'default_sort' ] ) ) { $ this -> main [ 'default_sort' ] = [ $ this -> main [ 'default_sort' ] ] ; $ this -> main [ 'default_sort' ] [ ] = $ strategy ; return $ this ; } $ this -> main [ 'default_sort' ] = $ strategy ; return $ this ; }
Set a sorting strategy to enable by default

Stacks strategies if called more than once

@param string $strategy  alias/name or <FQN>@<method> for custom ordering
@return ModelList|$this
Set a sorting strategy to enable by default