protected function _setupSort()
    {
        if (!($this->_sortEnabled = $this->_isSortEnabled())) {
            return;
        }

        $this->sortFields = $this->_getSortFields();

        foreach ($this->sortFields as $field => $options) {
            if (!isset($options['default'])) {
                continue;
            }
            $dir = strtolower($options['default']);
            if (in_array($dir, ['asc', 'desc'])) {
                $this->defaultSort = [
                    'field' => $field,
                    'dir' => $dir
                ];
            }
        }
    }
protected function _setupSort()
    {
        if (!($this->_sortEnabled = $this->_isSortEnabled())) {
            return;
        }

        $this->sortFields = $this->_getSortFields();

        foreach ($this->sortFields as $field => $options) {
            if (!isset($options['default'])) {
                continue;
            }
            $dir = strtolower($options['default']);
            if (in_array($dir, ['asc', 'desc'])) {
                $this->defaultSort = [
                    'field' => $field,
                    'dir' => $dir
                ];
            }
        }
    }
protected function _setupSort ( ) { if ( ! ( $ this -> _sortEnabled = $ this -> _isSortEnabled ( ) ) ) { return ; } $ this -> sortFields = $ this -> _getSortFields ( ) ; foreach ( $ this -> sortFields as $ field => $ options ) { if ( ! isset ( $ options [ 'default' ] ) ) { continue ; } $ dir = strtolower ( $ options [ 'default' ] ) ; if ( in_array ( $ dir , [ 'asc' , 'desc' ] ) ) { $ this -> defaultSort = [ 'field' => $ field , 'dir' => $ dir ] ; } } }
Setup default sort options.

@return void
Setup default sort options .