Sort asc data rows by column name

@return DataStore This datastore after sorted.
554112
public function sortKeys()
    {
        if ($this->isNotEmpty()) {
            foreach ($this->rows as &$row) {
                ksort($row);
            }
        }
        return $this;
    }
753920
public function getSortedCellList()
    {
        $sortKeys = array();
        foreach ($this->getCellList() as $coord) {
            sscanf($coord, '%[A-Z]%d', $column, $row);
            $sortKeys[sprintf('%09d%3s', $row, $column)] = $coord;
        }
        ksort($sortKeys);

        return array_values($sortKeys);
    }
145831
public function sortByNameDesc()
    {
        $this->sort(
            function (SplFileInfo $a, SplFileInfo $b) {
                return strcmp($b->getRealpath(), $a->getRealpath());
            }
        );
        return $this;
    }
1080041
public function sort(DataStructure\Sort $sorting)
    {
        $sortings = [];

        foreach ($sorting as $sortingEntity) {

            if ($this->isExcludedProperty($sortingEntity->getProperty())) {
                continue;
            }

            $sortings[$sortingEntity->getProperty()] =
                $sortingEntity instanceof DataStructure\Sort\Asc ? 'asc' : 'desc';
        }

        $this->criteria->orderBy($sortings);
    }
926970
public function orderBy($columns, $order = 'ASC', $nulls = null)
    {
        return $this->buildSelect()->orderBy($columns, $order, $nulls);
    }
1170546
public static function storagesSelectOptions()
    {
        return Yii::$app->cache->lazy(function () {
            return (new Query)
                ->select(['name', 'id'])
                ->from(PropertyStorage::tableName())
                ->orderBy(['sort_order' => SORT_ASC])
                ->indexBy('id')
                ->column();
        }, 'PropertyStorageId2Name', 86400, PropertyStorage::commonTag());
    }
1128524
@Override
	public SqlEntityQuery<E> asc(final String col, final Nulls nulls) {
		this.sortOrders.add(new SortOrder(col, Order.ASCENDING, nulls));
		return this;
	}
99424
public void sort(final int sortCol, final boolean sortAsc) {
		int[] rowIndexMappings = getTableModel().sort(sortCol, sortAsc);
		getOrCreateComponentModel().rowIndexMapping = rowIndexMappings;

		setSort(sortCol, sortAsc);

		if (rowIndexMappings == null) {
			// There's no way to correlate the previously selected row indices
			// with the new order of rows, so we need to clear out the selection.
			setSelectedRows(null);
			setExpandedRows(null);
		}
	}
315446
@Override
	public SqlEntityQuery<E> asc(final String... cols) {
		for (String col : cols) {
			this.sortOrders.add(new SortOrder(col, Order.ASCENDING));
		}
		return this;
	}
636282
public function ordering()
    {
        if ($this->orderCallback) {
            call_user_func($this->orderCallback, $this);

            return;
        }

        foreach ($this->request->orderableColumns() as $orderable) {
            $column           = $this->getColumnName($orderable['column']);
            $this->collection = $this->collection->sortBy(
                    function ($row) use ($column) {
                $data = $this->serialize($row);

                return Arr::get($data, $column);
            }
            );

            if ($orderable['direction'] == 'desc') {
                $this->collection = $this->collection->reverse();
            }
        }
    }
1125748
def sortByColumnName(self, name, order=QtCore.Qt.AscendingOrder):
        
        self.setSortingEnabled(True)
        self.sortByColumn(self.column(name), order)
1199729
public function orderBy($column, $type = 'asc')
    {
        if (! is_null($this->order)) {
            return $this;
        }

        if (!in_array($type, ['asc', 'desc'])) {
            $type = 'asc';
        }

        $this->order = 'order by `'.$column.'` '.$type;

        return $this;
    }
862201
def sortByColumn(self, index):
        """"""
        if self.sort_old == [None]:
            self.header_class.setSortIndicatorShown(True)
        sort_order = self.header_class.sortIndicatorOrder()
        self.sig_sort_by_column.emit()
        if not self.model().sort(index, sort_order):
            if len(self.sort_old) != 2:
                self.header_class.setSortIndicatorShown(False)
            else:
                self.header_class.setSortIndicator(self.sort_old[0],
                                                   self.sort_old[1])
            return
        self.sort_old = [index, self.header_class.sortIndicatorOrder()]
545303
public function sort(Sorting $sorting)
	{
		if (is_callable($sorting->getSortCallback())) {
			$data = call_user_func(
				$sorting->getSortCallback(),
				$this->data,
				$sorting->getSort()
			);

			if (!is_array($data)) {
				throw new DataGridArrayDataSourceException('Sorting callback has to return array');
			}

			$this->setData($data);

			return $this;
		}

		$sort = $sorting->getSort();

		foreach ($sort as $column => $order) {
			$data = [];

			foreach ($this->data as $item) {
				if (is_object($item[$column]) && $item[$column] instanceof \DateTimeInterface) {
					$sort_by = $item[$column]->format('Y-m-d H:i:s');
				} else {
					$sort_by = (string) $item[$column];
				}
				$data[$sort_by][] = $item;
			}

			if ($order === 'ASC') {
				ksort($data);
			} else {
				krsort($data);
			}

			$data_source = [];

			foreach ($data as $i) {
				foreach ($i as $item) {
					$data_source[] = $item;
				}
			}

			$this->setData($data_source);
		}

		return $this;
	}
84287
public function getListSorting()
    {
        $aListSorting = parent::getListSorting();

        if (array_keys($aListSorting['oxcountry']) === ['oxactive']) {
            $aListSorting['oxcountry'][$this->_getSecondSortFieldName()] = 'asc';
        }

        return $aListSorting;
    }
1099454
public function multiSortBy(array $columns)
    {
        foreach ($columns as $column => $direction) {
            if (strpos($column, '.')) {
                $this->sortByRelation($column, $direction);
            } else {
                $this->sortBy($column, $direction);
            }
        }

        return $this;
    }
914507
public function deleteAll()
    {
        // Count rows
        $count = $this->count();
        $tmpFile = tempnam("/tmp", uniqid() . '.tmp');
        $tempHandler = fopen($tmpFile, 'w');

        // Write the headings only and right away closes file
        fputcsv($tempHandler, $this->columns, $this->csvDelimiter);
        fclose($tempHandler);

        // Changes the original file to a temporary one.
        if (!rename($tmpFile, $this->filename)) {
            throw new DataStoreException("Failed to write the results to a file.");
        }

        return $count;
    }