Moodle  2.2.1
http://www.collinsharper.com
collatorlib Class Reference

Static Public Member Functions

static asort (array &$arr, $sortflag=null)
static compare ($str1, $str2)
static asort_objects_by_property (array &$objects, $property)
static asort_objects_by_method (array &$objects, $method)

Static Protected Member Functions

static ensure_collator_available ()

Static Protected Attributes

static $collator = null
static $locale = null

Detailed Description

Definition at line 604 of file textlib.class.php.


Member Function Documentation

static asort ( array &$  arr,
sortflag = null 
) [static]

Locale aware sorting, the key associations are kept, values are sorted alphabetically.

Parameters:
array$arrarray to be sorted (reference)
int$sortflagOne of Collator::SORT_REGULAR, Collator::SORT_NUMERIC, Collator::SORT_STRING
Returns:
void modifies parameter

Definition at line 681 of file textlib.class.php.

Here is the caller graph for this function:

static asort_objects_by_method ( array &$  objects,
method 
) [static]

Locale aware sort of objects by a method in common to all objects

Parameters:
array$objectsAn array of objects to sort (handled by reference)
string$methodThe method to call to generate a value for comparison
Returns:
bool True on success

Definition at line 728 of file textlib.class.php.

Here is the caller graph for this function:

static asort_objects_by_property ( array &$  objects,
property 
) [static]

Locale aware sort of objects by a property in common to all objects

Parameters:
array$objectsAn array of objects to sort (handled by reference)
string$propertyThe property to use for comparison
Returns:
bool True on success

Definition at line 716 of file textlib.class.php.

Here is the caller graph for this function:

static compare ( str1,
str2 
) [static]

Locale aware comparison of two strings.

Returns: 1 if str1 is greater than str2 0 if str1 is equal to str2 -1 if str1 is less than str2

Returns:
int

Definition at line 702 of file textlib.class.php.

static ensure_collator_available ( ) [static, protected]

Ensures that a collator is available and created

Returns:
bool Returns true if collation is available and ready

Definition at line 617 of file textlib.class.php.

Here is the call graph for this function:


Field Documentation

$collator = null [static, protected]

Definition at line 607 of file textlib.class.php.

$locale = null [static, protected]

Definition at line 610 of file textlib.class.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations