Sort column getter.

@return int
167214
private function getOrderField(): int
    {
        $result = (int)array_search($this->searchData['sort_by_field'], $this->getDisplayColumns());

        if ($this->batch && !$this->getGroupByField()) {
            $result += 1;
        }

        return $result;
    }
831513
protected function _getSorting()
    {
        $sOxIdParameter = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
        $sSynchOxidParameter = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');
        if ($sOxIdParameter && !$sSynchOxidParameter) {
            return 'order by oxactions2article.oxsort ';
        }

        return parent::_getSorting();
    }
395890
public function sort()
    {
        array_multisort(array_map(function ($pair) {
            return mb_convert_encoding($pair[0], 'UTF-16BE', 'UTF-8');
        }, $this->list), SORT_STRING, range(1, count($this->list)), $this->list);
    }
1251270
public function getSortBy()
    {
        $sortBy = isset($this->requestParams[self::PARAM_SORT_BY]) ?
            $this->requestParams[self::PARAM_SORT_BY] : self::DEFAULT_SORT_BY;
        return $sortBy;
    }
1103211
public function sortedSetOf(): self
    {
        $obj = clone $this;
        usort($obj->_elements,
            function (Element $a, Element $b) {
                $a_der = $a->toDER();
                $b_der = $b->toDER();
                return strcmp($a_der, $b_der);
            });
        return $obj;
    }
1219958
public function orderBy($column, $sort = 'ASC')
    {
        $sort = strtoupper($sort);
        if ($sort !== 'DESC') {
            $sort = 'ASC';
        }
        $this->order_by[$column] = $sort;

        return $this;
    }
1124536
protected function order()
    {
        $order = '';
        if (isset($this->request['order']) && count($this->request['order'])) {
            $orderBy = [];
            for ($i = 0, $ien = count($this->request['order']);$i<$ien;$i++) {
                $columnIdx = intval($this->request['order'][$i]['column']);
                $column = $this->columns[$columnIdx];
                if (!isset($column['orderable']) || $column['orderable'] === true) {
                    $orderBy[] = $this->toSQLColumn($column, 2).' '.(!isset($this->request['order'][$i]['dir']) || $this->request['order'][$i]['dir'] === 'asc' ? 'ASC' : 'DESC');
                }
            }
            $order = ' ORDER BY '.implode(', ', $orderBy);
        }

        return $order;
    }
999057
public function sort()
    {
        $deps = $this->all();
        $sorted = $this->sortDeps($deps);

        return $this->dependency->getSorted($sorted);
    }
817013
public function sortByTypeDesc()
    {
        $this->sort(
            function (SplFileInfo $a, SplFileInfo $b) {
                if ($a->isDir() && $b->isFile()) {
                    return 1;
                } elseif ($a->isFile() && $b->isDir()) {
                    return -1;
                }
                return strcmp($b->getRealpath(), $a->getRealpath());
            }
        );

        return $this;
    }
1064891
public function getSortNext()
	{
		$defaultSort = $this->grid->getColumnDefaultSort($this->key);

		if ($this->sort == 'ASC') {
			return [$this->key => $defaultSort === 'DESC' ? FALSE : 'DESC'];
		} else if ($this->sort == 'DESC') {
			return [$this->key => $defaultSort === 'DESC' ? 'ASC' : FALSE];
		}

		return [$this->key => 'ASC'];
	}
1061593
public function sortColumn(string $column)
    {
        $array = $this->dump();

        usort($array, static function ($a, $b) use ($column) {
            return strcmp(
                Arr::get($a, $column),
                Arr::get($b, $column)
            );
        });

        return $this->bindNewInstance($array);
    }
245947
public function get_sql_sort() {
        $columns = $this->get_sort_columns();
        if (count($columns) == 1 && isset($columns['timemodified']) && $columns['timemodified'] == SORT_DESC) {
            // Add the 'id' column when we are using the default sorting.
            $columns['id'] = SORT_DESC;
            return self::construct_order_by($columns);
        }
        return parent::get_sql_sort();
    }
128572
public function sortBy($column, $order = 'asc')
    {
        $this->prepare();

        if (!is_array($this->_map)) {
            return $this;
        }

        usort($this->_map, function ($a, $b) use ($column, $order) {
            $val1 = $this->getFromNested($a, $column);
            $val2 = $this->getFromNested($b, $column);
            if (is_string($val1)) {
                $val1 = strtolower($val1);
            }

            if (is_string($val2)) {
                $val2 = strtolower($val2);
            }

            if ($val1 == $val2) {
                return 0;
            }
            $order = strtolower(trim($order));

            if ($order == 'desc') {
                return ($val1 > $val2) ? -1 : 1;
            } else {
                return ($val1 < $val2) ? -1 : 1;
            }
        });

        return $this;
    }
870586
public function getSort()
    {
        if ($this->_sort === null) {
            $this->_sort = (float)$this->extractTag('sort', 0);
        }

        return $this->_sort;
    }
1015571
private function sort()
    {
        if (!$this->sorted) {
            $this->sorted = true;
            return usort($this->requestRates, function (array $requestRateA, array $requestRateB) {
                // PHP 7: Switch to the <=> "Spaceship" operator
                return $requestRateB['rate'] > $requestRateA['rate'];
            });
        }
        return $this->sorted;
    }
260278
private function sortQuery()
    {
        if ($this->queryConfiguration->hasOrderColumn()) {
            $orderColumns = $this->queryConfiguration->orderColumns();

            foreach($orderColumns as $order) {
                $this->query->orderBy($order->columnName(), $order->isDescending() ? 'desc' : 'asc');
            }
        }
    }
668382
public function getGridOrder() {
        $criteria = Yii::$app->session[$this->sessionVarName];
        return self::convertGridSort($criteria);
    }