Determine the current sorting columns.

@param GroupAndSortingDefinitionInterface|null $sortingDefinition The sorting definition.

@return array
485294
private function getSortingColumns($sortingDefinition)
    {
        if (null === $sortingDefinition) {
            return [];
        }

        $sortingColumns = [];
        /** @var GroupAndSortingDefinitionInterface $sortingDefinition */
        foreach ($sortingDefinition as $information) {
            /** @var GroupAndSortingInformationInterface $information */
            if ($information->getProperty()) {
                $sortingColumns[] = $information->getProperty();
            }
        }

        return $sortingColumns;
    }
1247131
private function getDisplayColumns(): array
    {
        if (! empty($this->displayColumns)) {
            return $this->displayColumns;
        }

        $this->displayColumns = $this->searchData['display_columns'];

        $groupByField = $this->getGroupByField();

        if ($groupByField) {
            list($prefix, ) = pluginSplit($groupByField);
            $countField = $prefix . '.' . Search::GROUP_BY_FIELD;

            $this->displayColumns = [$groupByField, $countField];
        }

        return $this->displayColumns;
    }
308399
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';
    }
251094
public static function array_multisort_column( &$sourceArray, $column, $sortDirection = SORT_ASC )
    {
        $_sortColumn = array();

        foreach ( $sourceArray as $_key => $_row )
        {
            $_sortColumn[$_key] = ( isset( $_row[$column] ) ? $_row[$column] : null );
        }

        return \array_multisort( $_sortColumn, $sortDirection, $sourceArray );
    }
441972
private function sortGroup(array $group)
    {
        if (empty($group)) {
            return [];
        }

        if ($this->sortType == self::SORT_TYPE_LENGTH) {
            usort($group, function ($a, $b) {
                $cmp = strlen($b) - strlen($a);

                if ($cmp === 0) {
                    $a = strtolower($a);
                    $b = strtolower($b);

                    $cmp = strcmp($b, $a);
                }

                return $cmp;
            });
        } elseif ($this->sortType == self::SORT_TYPE_ALPHABETIC) {
            usort($group, function ($a, $b) {
                $a = strtolower($a);
                $b = strtolower($b);

                $cmp = strcmp($b, $a);
                if ($cmp === 0) {
                    $cmp = strlen($b) - strlen($a);
                }

                return $cmp;
            });
        }

        if ($this->sortDirection == self::SORT_DIRECTION_ASC) {
            $group = array_reverse($group);
        }

        return $group;
    }
627361
@Override
	public List<CPDefinitionOptionRel> findByGroupId(long groupId) {
		return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
1367819
protected function getCustomSortingList() : array
    {
        $arEventResult = Event::fire('shopaholic.promo_block.sorting.get.list', [$this->sValue]);
        if (empty($arEventResult)) {
            return [];
        }

        $arElementIDList = [];
        foreach ($arEventResult as $arEventPromoBlockIDList) {
            if (empty($arEventPromoBlockIDList) || !is_array($arEventPromoBlockIDList)) {
                continue;
            }

            $arElementIDList = $arEventPromoBlockIDList;
            break;
        }

        return $arElementIDList;
    }
112064
private function _sortDirection()
    {
        $collection = ResourceTable::collection();
        $sort = $collection->getSort();

        return $sort['dir'] ? $sort['dir'] : ResourceTable::DEFAULT_SORT_DIR;
    }
1104310
@Override
	public List<CPDefinitionGroupedEntry> findAll() {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
927679
public function getSorting()
    {
        $sortOrder = $this->getRequest()->get('sortOrder', 'asc');
        $sortBy = $this->getRequest()->get('sortBy', 'id');

        return [$sortBy => $sortOrder];
    }
493996
protected function extractSortInfo($sortAnnotation)
    {
        $sortInfo = ['direction' => null, 'column' => null];
        if ($sortAnnotation) {
            $direction = $sortAnnotation->direction;
            $sortInfo['direction'] = $direction;
            $column = $sortAnnotation->column;
            $sortInfo['column'] = $column;
        }

        return $sortInfo;
    }
872751
private function getDefaultSortable()
    {
        if (config('columnsortable.default_first_column', false)) {
            $sortBy = array_first($this->sortable);
            if ( ! is_null($sortBy)) {
                return [$sortBy => config('columnsortable.default_direction', 'asc')];
            }
        }

        return null;
    }
82986
protected function _sort()
    {
        if (!isset($this->_sorts) || count($this->_sorts) === 0) {
            return;
        }

        $columns      = $this->_dataGrid->getActiveColumnsOrdered();
        $sorts        = $this->_sorts;
        $sortPosition = $this->_sortPositions;

        usort($this->_output, function ($a, $b) use ($columns, $sortPosition, $sorts) {
            foreach ($sortPosition as $colIndex) {
                $sort = $sorts[$colIndex];
                /** @var $sort\RBM\Datagrid\Data\Sort */
                /** @var $column\RBM\Datagrid\Column */
                $column = $columns[$colIndex];
                $valueA = $column->getSortData($a);
                $valueB = $column->getSortData($b);

                if ($valueA == $valueB) {
                    continue;
                }

                $arr = array($valueA, $valueB);

                $args = array_merge(array(&$arr), array($sort->getDirection(), $sort->getType()));
                call_user_func_array('array_multisort', $args);

                return ($arr[0] == $valueA) ? -1 : 1;
            }
            return 0;
        });
    }
216346
public function getListSorting()
    {
        if ($this->_aCurrSorting === null) {
            $this->_aCurrSorting = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sort');

            if (!$this->_aCurrSorting && $this->_sDefSortField && ($baseObject = $this->getItemListBaseObject())) {
                $this->_aCurrSorting[$baseObject->getCoreTableName()] = [$this->_sDefSortField => "asc"];
            }
        }

        return $this->_aCurrSorting;
    }
281998
public function getSortableDirection($direction = null)
    {
        if ( ! is_null($direction))
        {
            return $this->validateSortableDirection($direction);
        }

        return $this->getDefaultSortableDirection();
    }
201103
public function getFieldDefinitionById($fieldDefinitionId)
    {
        if (isset($this->fieldDefinitionsById[$fieldDefinitionId])) {
            return $this->fieldDefinitionsById[$fieldDefinitionId];
        }

        return null;
    }
765694
public function getListSorting()
    {
        $aSorting = parent::getListSorting();
        if (isset($aSorting["oxnews"][$this->_sDefSortField])) {
            $this->_blDesc = true;
        }

        return $aSorting;
    }