protected function getActualSortDirection($column = null)
    {
        $column = $column ?: $this->activeSort;

        if (null !== $this->activeSortDescending) {
            return $this->activeSortDescending ? 'desc' : 'asc';
        }

        if ( ! isset($this->getModelInformation()->list->columns[$column])) {

            if (null === $column) {
                return $this->getActualSortDirection($this->getDefaultSort());
            }

            return 'asc';
        }

        $direction = $this->getModelInformation()->list->columns[$column]->sort_direction;

        return strtolower($direction) === 'desc' ? 'desc' : 'asc';
    }
protected function getActualSortDirection($column = null)
    {
        $column = $column ?: $this->activeSort;

        if (null !== $this->activeSortDescending) {
            return $this->activeSortDescending ? 'desc' : 'asc';
        }

        if ( ! isset($this->getModelInformation()->list->columns[$column])) {

            if (null === $column) {
                return $this->getActualSortDirection($this->getDefaultSort());
            }

            return 'asc';
        }

        $direction = $this->getModelInformation()->list->columns[$column]->sort_direction;

        return strtolower($direction) === 'desc' ? 'desc' : 'asc';
    }
protected function getActualSortDirection ( $ column = null ) { $ column = $ column ? : $ this -> activeSort ; if ( null !== $ this -> activeSortDescending ) { return $ this -> activeSortDescending ? 'desc' : 'asc' ; } if ( ! isset ( $ this -> getModelInformation ( ) -> list -> columns [ $ column ] ) ) { if ( null === $ column ) { return $ this -> getActualSortDirection ( $ this -> getDefaultSort ( ) ) ; } return 'asc' ; } $ direction = $ this -> getModelInformation ( ) -> list -> columns [ $ column ] -> sort_direction ; return strtolower ( $ direction ) === 'desc' ? 'desc' : 'asc' ; }
Returns the sort direction that is actually active, determined by
the specified sort direction with a fallback to the default.

@param string|null $column
@return string   asc|desc
Returns the sort direction that is actually active determined by the specified sort direction with a fallback to the default .