Adds sort for the specified property with the specified direction.

@param propertyName  the specified property name to sort
@param sortDirection the specified sort
@return the current query object
482849
public Query addSort(final String propertyName, final SortDirection sortDirection) {
        sorts.put(propertyName, sortDirection);

        return this;
    }
1120989
public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) {
		FieldType fieldType = verifyColumnName(columnName);
		if (fieldType.isForeignCollection()) {
			throw new IllegalArgumentException("Can't orderBy foreign collection field: " + columnName);
		}
		addOrderBy(new OrderBy(columnName, ascending));
		return this;
	}
637591
public function sortByProperty( $property, $direction = null )
    {
        $this->sort( $this->generateSortByPropertyClosure( $property, $direction ) );
        return $this;
    }
73818
function (locationsarray) {
			this.writeDebug('sortNumerically',arguments);
			var property = (
				this.settings.sortBy !== null &&
				this.settings.sortBy.hasOwnProperty('prop') &&
				typeof this.settings.sortBy.prop !== 'undefined'
			) ?  this.settings.sortBy.prop : 'distance';

			if (this.settings.sortBy !== null && this.settings.sortBy.hasOwnProperty('order') && this.settings.sortBy.order.toString() === 'desc') {
				locationsarray.sort(function (a, b) {
					return ((b[property] < a[property]) ? -1 : ((b[property] > a[property]) ? 1 : 0));
				});
			} else {
				locationsarray.sort(function (a, b) {
					return ((a[property] < b[property]) ? -1 : ((a[property] > b[property]) ? 1 : 0));
				});
			}
		}
458505
private static Sort first(String columnName, Sort.Order order) {
        return Sort.on(columnName, order);
    }
925088
public SortOption add(String attribute, Direction direction) {
        sortedAttributes.add(new SortedAttribute(attribute, direction));
        return this;
    }
583298
public Query addSortAsc(Sort column)
    {
        this.sorts.add(new SortSpec(SortOrder.ASCENDING, column));
        return this;
    }
187446
public static function create(array $properties, Direction $direction = null) : Sort
    {
        if ($direction === null) {
            $direction = Direction::$ASC;
        }
        $orders = [];
        foreach ($properties as $property) {
            $orders[] = new Order($direction, $property);
        }
        return new self($orders);
    }
1282450
public boolean addProperty(String propertyName) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(propertyName)) {
            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.get().getBundle().key(Messages.LOG_ADD_PROP_1, propertyName));
            }
            return m_properties.add(propertyName);
        } else {
            return false;
        }
    }
1340686
function processSortDirection(feed,sort,sortDirection,sortDirectionName) {
	exportSortDirection(feed,sort,sortDirection,sortDirectionName);
}
1197527
public Query select(final String propertyName, final String... propertyNames) {
        projections.add(new Projection(propertyName));

        if (null != propertyNames && 0 < propertyNames.length) {
            for (int i = 0; i < propertyNames.length; i++) {
                projections.add(new Projection(propertyNames[i]));
            }
        }

        return this;
    }
256752
function(property, sorted) {
            var getters = this.__collectAllPropertyValues.apply(this, ['__getters', 1].concat(property || []));

            if (!property) {
                return getters;
            }

            getters = getters[property];

            if (!sorted) {
                return getters[property];
            }

            var sortedGetters = [];

            for (var name in getters) {
                sortedGetters.push(getters[name]);
            }

            sortedGetters = sortedGetters.sort(function(s1, s2) { return s2[0] - s1[0]; });

            for (var i = 0, ii = sortedGetters.length; i < ii; ++i) {
                sortedGetters[i] = sortedGetters[i][1];
            }

            return sortedGetters;
        }
156829
def sort_by(self, property, order="asc"):
        
        self.__prepare()
        if isinstance(self._json_data, list):
            if order == "asc":
                self._json_data = sorted(
                    self._json_data,
                    key=lambda x: x.get(property)
                )
            else:
                self._json_data = sorted(
                    self._json_data,
                    key=lambda x: x.get(property),
                    reverse=True
                )

        return self
940748
public static PropertyOrder.Builder makeOrder(String property,
      PropertyOrder.Direction direction) {
    return PropertyOrder.newBuilder()
        .setProperty(makePropertyReference(property))
        .setDirection(direction);
  }
1147745
def sort(self, *sort_tuples):
        ''' 
        '''
        query = self
        for name, direction in sort_tuples:
            field = resolve_name(self.type, name)
            if direction in (ASCENDING, 1):
                query = query.ascending(field)
            elif direction in (DESCENDING, -1):
                query = query.descending(field)
            else:
                raise BadQueryException('Bad sort direction: %s' % direction)
        return query
105572
public static <S extends Storable> OrderedProperty<S> get(StorableProperty<S> property,
                                                              Direction direction) {
        return get(ChainedProperty.get(property), direction);
    }
818177
public void setSort(String property, Boolean order) {
    	SortOrder sortOrder = order==null?SortOrder.ASCENDING:(order?SortOrder.ASCENDING:SortOrder.DESCENDING);
    	if(property==null) {
    		if(order==null) setSort(null);
    		else setSort("@rid", sortOrder);
    	} else {
    		super.setSort(property, sortOrder);
    	}
    }