Sorts the elements in the entire Collection<T> using the specified comparer.
@param ComparerInterface $comparer The ComparerInterface implementation to use when comparing elements, or null
to use the default comparer Comparer<T>.Default.
@return $this
550635
public function sort(ComparerInterface $comparer = null)
    {
        if ($comparer === null) {
            $comparer = $this->getDefaultComparer();
        }
        usort($this->container, array($comparer, 'compare'));

        return $this;
    }
439686
public function filterBy($column, $value, $comparison = Comparison::EQUAL, $outerMode = Link::LINK_DEFAULT)
    {
        return $this->addCriterion(new Criterion($column, $value, $comparison), null, $outerMode);
    }
810415
public function sorted(callable $comparator = null): Map
    {
        $copy = $this->copy();
        $copy->sort($comparator);
        return $copy;
    }
598764
public static Sort.Order toSortOrder(ComparatorItem comparatorItem) {
    if (comparatorItem == null || comparatorItem.getField() == null
        || comparatorItem.getField().trim().length() == 0) {
      return null;
    }
    Sort.Direction direction = comparatorItem.isAsc() ? Sort.Direction.ASC : Sort.Direction.DESC;
    Sort.NullHandling nullHandlingHint =
        comparatorItem.isNullIsFirst() ? Sort.NullHandling.NULLS_FIRST
            : Sort.NullHandling.NULLS_LAST;
    Sort.Order order = new Sort.Order(direction, comparatorItem.getField(), nullHandlingHint);
    if (comparatorItem.isIgnoreCase()) {
      return order.ignoreCase();
    }
    return order;
  }
960412
public BeanQuery<T> orderBy(Comparator... beanComparator) {
    this.comparator = new DelegatedSortOrderableComparator(ComparatorUtils.chainedComparator(beanComparator));
    return this;
  }
563601
protected function getValueFromComparison(Comparison $comparison)
    {
        $value = $comparison->getValue()->getValue();

        return $comparison->getOperator() == Comparison::CONTAINS
            ? "%{$value}%"
            : $value;
    }
1243428
public function sort($sort = null)
    {
        deprecationWarning(
            'BelongToMany::sort() is deprecated. ' .
            'Use setSort()/getSort() instead.'
        );
        if ($sort !== null) {
            $this->setSort($sort);
        }

        return $this->getSort();
    }
356780
public function registerChecker(CheckerInterface $checker)
    {
        if (!$this->hasChecker($checker)) {
            $this->checkers[] = $checker;
        }

        return $this;
    }
352993
public static <T> Comparator<T> comparator(CheckedComparator<T> comparator) {
        return Unchecked.comparator(comparator, Unchecked.RETHROW_ALL);
    }
149541
protected function sortCompareValues($a, $b)
    {
        if (is_numeric($a) && is_numeric($b)) {
            return $this->sortCompareNumeric((float)$a, (float)$b);
        }

        if (is_string($a) && is_string($b)) {
            return $this->sortCompareStrings($a, $b);
        }

        return ($a < $b) ? -1 : (int)($a > $b);
    }
997
protected function getOpenComparisonContainer($comparison)
    {
        switch ($comparison) {
            case SearchCriterion::GREATER_EQUAL:
            case SearchCriterion::LESS_EQUAL:
            case SearchCriterion::ISNULL:
            case SearchCriterion::ISNOTNULL:
                return '[';
            case SearchCriterion::GREATER_THAN:
            case SearchCriterion::LESS_THAN:
                return '{';
            default:
                throw new InvalidArgumentException('Invalid comparison for RangeCriterion');
        }
    }
1228786
public function configureSelector(PaginatorAwareInterface $selector)
    {
        if (empty($this->state)) {
            throw new ListingException("Unable to pagination without state being set");
        }

        $this->validateSelector($selector);

        foreach ($this->activeFilters() as $filter) {
            $selector = $filter->apply($selector);
        }

        if (!empty($sorter = $this->activeSorter())) {
            $selector = $sorter->apply($selector);
        }

        //Pagination
        $selector->setPaginator($this->createPaginator());

        return $selector;
    }
1189464
public function sort(callable $comparator = null)
    {
        if ($comparator) {
            usort($this->pairs, function($a, $b) use ($comparator) {
                return $comparator($a->value, $b->value);
            });

        } else {
            usort($this->pairs, function($a, $b) {
                return $a->value <=> $b->value;
            });
        }
    }
363601
public function sort(Sorting $sorting)
	{
		/**
		 * there is only one iteration
		 */
		foreach ($sorting->getSort() as $column => $order) {
			$this->sort_column = $column;
			$this->order_column = $order;
		}

		return $this;
	}
1374121
public function unique(callable $comparator = null)
    {
        if (!$comparator) {
            $this->source = array_values(array_unique($this->source));
        }

        return $this;
    }
983086
public function vnSeparator(array $vnSeparator = null)
    {
        if ($vnSeparator !== null) {
            $this->vnSeparator = $vnSeparator;
            return $this;
        }
        return $this->vnSeparator;
    }
552349
public function sort(?callable $comparator = null): Sequence
    {
        $comparator ?
            $this->items->sort($comparator) :
            $this->items->sort();

        return $this;
    }