Orders by the specified property name and direction

@param propertyName The property name to order by
@param direction Either "asc" for ascending or "desc" for descending

@return A Order instance
774848
public org.grails.datastore.mapping.query.api.Criteria order(String propertyName, String direction) {
        if (criteria == null) {
            throwRuntimeException(new IllegalArgumentException("Call to [order] with propertyName [" +
                    propertyName + "]not allowed here."));
        }
        propertyName = calculatePropertyName(propertyName);
        Order o;
        if (direction.equals(ORDER_DESCENDING)) {
            o = Order.desc(propertyName);
        }
        else {
            o = Order.asc(propertyName);
        }
        if (paginationEnabledList) {
            orderEntries.add(o);
        }
        else {
            criteria.addOrder(o);
        }
        return this;
    }
292200
def sort_direction(self):
        

        if self.table._meta.order_by == self.name:
            return "asc"

        elif self.table._meta.order_by == ("-" + self.name):
            return "desc"

        else:
            return None
778586
public function order($columns, $direction = 'ASC')
    {
        foreach ((array) $columns as $column)
        {
            $this->order[] = array(
                'column'    => $column,
                'direction' => $direction
            );
        }

        return $this;
    }
969274
function sortBy(tree, propertyName) {
    var _this = this;

    // It is needed an array structure to sort.
    if (!_.isArray(tree)) tree = [tree];
    tree.forEach(function (item) {
      return _(item).keys().forEach(function (key) {
        if (_.isArray(item[key])) item[key] = _this.sortBy(item[key], propertyName);
      });
    });
    return _.sortBy(tree, propertyName);
  }
226567
public Swagger2MarkupConfigBuilder withPropertyOrdering(Comparator<String> propertyOrdering) {
        Validate.notNull(propertyOrdering, "%s must not be null", "propertyOrdering");

        config.propertyOrderBy = OrderBy.CUSTOM;
        config.propertyOrdering = propertyOrdering;
        return this;
    }
1034756
public OrderedProperty<S> getOrderedProperty(int index) {
        return OrderedProperty.get(mProperties[index], mDirections[index]);
    }
630035
@SuppressWarnings("unchecked")
    public OrderedProperty<S>[] getOrderedProperties() {
        OrderedProperty<S>[] ordered = new OrderedProperty[mProperties.length];
        for (int i=mProperties.length; --i>=0; ) {
            ordered[i] = OrderedProperty.get(mProperties[i], mDirections[i]);
        }
        return ordered;
    }
1028427
@NonNull
    public static SortOrder property(@NonNull String property) {
        if (property == null) {
            throw new IllegalArgumentException("property cannot be null.");
        }
        return expression(Expression.property(property));
    }
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
234027
public OrderDirection BY(String attributeName) {
		OrderBy ob = this.orderExpression.getCreateOrderCriteriaFor(attributeName);
		OrderDirection ret = new OrderDirection(ob);
		QueryRecorder.recordInvocation(this, "BY", ret, QueryRecorder.literal(attributeName));
		return ret;
	}
579443
public static EnumFacing getDirection(IBlockState state)
	{
		DirectionalComponent dc = IComponent.getComponent(DirectionalComponent.class, state.getBlock());
		if (dc == null)
			return EnumFacing.SOUTH;

		PropertyDirection property = dc.getProperty();
		if (property == null || !state.getProperties().containsKey(property))
			return EnumFacing.SOUTH;

		return state.getValue(property);
	}
100593
public function setDirection($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\PropertyOrder_Direction::class);
        $this->direction = $var;

        return $this;
    }
42929
public function orderBy($column, $direction = 'asc')
    {
        $property = $this->unions ? 'unionOrders' : 'orders';

        $direction = strtolower($direction) == 'asc' ? 'asc' : 'desc';

        $this->{$property}[] = compact('column', 'direction');

        return $this;
    }
251034
protected String getRootPropertyName(String propertyName) {
		int location = propertyName.indexOf(PROPERTY_KEY_PREFIX);
		return location == -1 ? propertyName : propertyName.substring(0, location);
	}
935272
public static <T> List<T> sortByProperty(List<T> list, String property) {
		return sort(list, new PropertyComparator<>(property));
	}
970804
public function orderBy($field, $direction = 'asc')
    {
        $this->setOrderByField($field);
        $this->setOrderByDirection($direction);

        return $this;
    }
343799
public function sortBy($field, $direction = 'desc')
    {
        $this->sortByField = $field;

        if (strtolower($direction) === 'asc') {
            $this->sortByDirection = SORT_ASC;
        } else {
            $this->sortByDirection = SORT_DESC;
        }

        return $this;
    }