MediaWiki
REL1_34
UppercaseCollation.php
Go to the documentation of this file.
1
<?php
23
class
UppercaseCollation
extends
Collation
{
24
25
private
$lang
;
26
27
public
function
__construct
() {
28
// Get a language object so that we can use the generic UTF-8 uppercase
29
// function there
30
$this->lang = Language::factory(
'en'
);
31
}
32
33
public
function
getSortKey
( $string ) {
34
return
$this->lang->uc( $string );
35
}
36
37
public
function
getFirstLetter
( $string ) {
38
if
( $string[0] ==
"\0"
) {
39
$string = substr( $string, 1 );
40
}
41
return
$this->lang->ucfirst( $this->lang->firstChar( $string ) );
42
}
43
44
}
Collation
Definition
Collation.php:29
UppercaseCollation
Definition
UppercaseCollation.php:23
UppercaseCollation\getFirstLetter
getFirstLetter( $string)
Given a string, return the logical "first letter" to be used for grouping on category pages and so on...
Definition
UppercaseCollation.php:37
UppercaseCollation\__construct
__construct()
Definition
UppercaseCollation.php:27
UppercaseCollation\getSortKey
getSortKey( $string)
Given a string, convert it to a (hopefully short) key that can be used for efficient sorting.
Definition
UppercaseCollation.php:33
UppercaseCollation\$lang
$lang
Definition
UppercaseCollation.php:25
includes
collation
UppercaseCollation.php
Generated on Mon Nov 25 2024 16:05:00 for MediaWiki by
1.10.0