W3cubDocs

/Symfony 2.7

Symfony\Component\Locale\Stub\StubCollator

class StubCollator extends Collator

Alias of {@link \Symfony\Component\Intl\Collator\Collator}.

Constants

FRENCH_COLLATION
ALTERNATE_HANDLING
CASE_FIRST
CASE_LEVEL
NORMALIZATION_MODE
STRENGTH
HIRAGANA_QUATERNARY_MODE
NUMERIC_COLLATION
DEFAULT_VALUE
PRIMARY
SECONDARY
TERTIARY
DEFAULT_STRENGTH
QUATERNARY
IDENTICAL
OFF
ON
SHIFTED
NON_IGNORABLE
LOWER_FIRST
UPPER_FIRST
SORT_REGULAR
SORT_NUMERIC
SORT_STRING

Methods

__construct(string $locale)

Constructor

from Collator
static Collator create(string $locale)

Static constructor

from Collator
Boolean asort(array $array, integer $sortFlag = self::SORT_REGULAR)

Sort array maintaining index association

from Collator
Boolean|int compare(string $str1, string $str2)

Not supported.

from Collator
Boolean|int getAttribute(int $attr)

Not supported.

from Collator
int getErrorCode()

Returns collator's last error code.

from Collator
string getErrorMessage()

Returns collator's last error message.

from Collator
string getLocale(int $type = Locale::ACTUAL_LOCALE)

Returns the collator's locale

from Collator
string getSortKey(string $string)

Not supported.

from Collator
Boolean|int getStrength()

Not supported.

from Collator
Boolean setAttribute(int $attr, int $val)

Not supported.

from Collator
Boolean setStrength(int $strength)

Not supported.

from Collator
Boolean sortWithSortKeys(array $arr)

Not supported.

from Collator
Boolean sort(array $arr, int $sortFlag = self::SORT_REGULAR)

Not supported.

from Collator

Details

public __construct(string $locale)

Constructor

Parameters

string $locale The locale code. The only currently supported locale is "en".

Exceptions

MethodArgumentValueNotImplementedException When $locale different than "en" is passed

static public Collator create(string $locale)

Static constructor

Parameters

string $locale The locale code. The only currently supported locale is "en".

Return Value

Collator

Exceptions

MethodArgumentValueNotImplementedException When $locale different than "en" is passed

public Boolean asort(array $array, integer $sortFlag = self::SORT_REGULAR)

Sort array maintaining index association

Parameters

array $array Input array
integer $sortFlag Flags for sorting, can be one of the following: Collator::SORTREGULAR - compare items normally (don't change types) Collator::SORTNUMERIC - compare items numerically Collator::SORT_STRING - compare items as strings

Return Value

Boolean True on success or false on failure

public Boolean|int compare(string $str1, string $str2)

Not supported.

Compare two Unicode strings

Parameters

string $str1 The first string to compare
string $str2 The second string to compare

Return Value

Boolean|int Return the comparison result or false on failure: 1 if $str1 is greater than $str2 0 if $str1 is equal than $str2 -1 if $str1 is less than $str2

Exceptions

MethodNotImplementedException

See also

http://www.php.net/manual/en/collator.compare.php

public Boolean|int getAttribute(int $attr)

Not supported.

Get a value of an integer collator attribute

Parameters

int $attr An attribute specifier, one of the attribute constants

Return Value

Boolean|int The attribute value on success or false on error

Exceptions

MethodNotImplementedException

See also

http://www.php.net/manual/en/collator.getattribute.php

public int getErrorCode()

Returns collator's last error code.

Always returns the UZEROERROR class constant value

Return Value

int The error code from last collator call

public string getErrorMessage()

Returns collator's last error message.

Always returns the UZEROERROR_MESSAGE class constant value

Return Value

string The error message from last collator call

public string getLocale(int $type = Locale::ACTUAL_LOCALE)

Returns the collator's locale

Parameters

int $type Not supported. The locale name type to return (Locale::VALIDLOCALE or Locale::ACTUALLOCALE)

Return Value

string The locale used to create the collator. Currently always returns "en".

public string getSortKey(string $string)

Not supported.

Get sorting key for a string

Parameters

string $string The string to produce the key from

Return Value

string The collation key for $string

Exceptions

MethodNotImplementedException

See also

http://www.php.net/manual/en/collator.getsortkey.php

public Boolean|int getStrength()

Not supported.

Get current collator's strength

Return Value

Boolean|int The current collator's strength or false on failure

Exceptions

MethodNotImplementedException

See also

http://www.php.net/manual/en/collator.getstrength.php

public Boolean setAttribute(int $attr, int $val)

Not supported.

Set a collator's attribute

Parameters

int $attr An attribute specifier, one of the attribute constants
int $val The attribute value, one of the attribute value constants

Return Value

Boolean True on success or false on failure

Exceptions

MethodNotImplementedException

See also

http://www.php.net/manual/en/collator.setattribute.php

public Boolean setStrength(int $strength)

Not supported.

Set the collator's strength

Parameters

int $strength Strength to set, possible values: Collator::PRIMARY Collator::SECONDARY Collator::TERTIARY Collator::QUATERNARY Collator::IDENTICAL Collator::DEFAULT

Return Value

Boolean True on success or false on failure

Exceptions

MethodNotImplementedException

See also

http://www.php.net/manual/en/collator.setstrength.php

public Boolean sortWithSortKeys(array $arr)

Not supported.

Sort array using specified collator and sort keys

Parameters

array $arr Array of strings to sort

Return Value

Boolean True on success or false on failure

Exceptions

MethodNotImplementedException

See also

http://www.php.net/manual/en/collator.sortwithsortkeys.php

public Boolean sort(array $arr, int $sortFlag = self::SORT_REGULAR)

Not supported.

Sort array using specified collator

Parameters

array $arr Array of string to sort
int $sortFlag Optional sorting type, one of the following: Collator::SORTREGULAR Collator::SORTNUMERIC Collator::SORT_STRING

Return Value

Boolean True on success or false on failure

Exceptions

MethodNotImplementedException

See also

http://www.php.net/manual/en/collator.sort.php

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Locale/Stub/StubCollator.html