Skip to the content.

Sorter builder configuration

The sorter builder Budgegeria\IntlSort\Builder allows to adapt the sorting behaviour additional to local conventions. The effects may differ between the supported locales. You can read more about the different concepts on the ICU homepage.

Case First

Case First allows setting upper case or lower case letters to be first in the order of elements.

Numeric Collation

The Numeric Collation enables how numeric values should be ordered.

Strength

Also known as Comparison Levels, a strength can influence the matching conditions between strings and how they are ordered. This can also be used for performance improvements you don’t need a stricter comparison.

Read more at the ICU homepage

Case Level

The Case Level is used when ignoring accents but not case. In such a situation, use e.g. strength primaryStrength() and enableCaseLevel(). It can also affect performance.

Normalization Mode

The Normalization setting determines whether text is thoroughly normalized or not in comparison.

French Collation

Some French dictionary ordering traditions sort strings with different accents from the back of the string. This attribute is automatically enabled for the Canadian French locale (fr_CA). Enabling it increases the string comparison performance cost, but not sort key length.

Alternate Handling

The Alternate attribute is used to control the handling of the so called variable characters in the UCA: whitespace, punctuation and symbols.

Order By

Configures the sort order and which part of the elements are the focus for the sorting.

Omit array keys

Null value position

Positioning of null values at the start or at the end of all elements.

getSorter()

Returns a Sorter instance with the given configuration. Every call creates a new instance.

getComparator()

Returns a Comparator instance with the given configuration. Every call creates a new instance.

Home