MediaWiki
REL1_35
UppercaseCollation.php
Go to the documentation of this file.
1
<?php
23
use
MediaWiki\MediaWikiServices
;
24
25
class
UppercaseCollation
extends
Collation
{
26
27
private
$lang
;
28
29
public
function
__construct
() {
30
// Get a language object so that we can use the generic UTF-8 uppercase
31
// function there
32
$this->lang = MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage(
'en'
);
33
}
34
35
public
function
getSortKey
( $string ) {
36
return
$this->lang->uc( $string );
37
}
38
39
public
function
getFirstLetter
( $string ) {
40
if
( $string[0] ==
"\0"
) {
41
$string = substr( $string, 1 );
42
}
43
return
$this->lang->ucfirst( $this->lang->firstChar( $string ) );
44
}
45
46
}
Collation
Definition
Collation.php:30
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition
MediaWikiServices.php:152
UppercaseCollation
Definition
UppercaseCollation.php:25
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:39
UppercaseCollation\__construct
__construct()
Definition
UppercaseCollation.php:29
UppercaseCollation\getSortKey
getSortKey( $string)
Given a string, convert it to a (hopefully short) key that can be used for efficient sorting.
Definition
UppercaseCollation.php:35
UppercaseCollation\$lang
$lang
Definition
UppercaseCollation.php:27
includes
collation
UppercaseCollation.php
Generated on Sat Apr 6 2024 00:07:01 for MediaWiki by
1.9.8