MediaWiki master
IdentityCollation.php
Go to the documentation of this file.
1<?php
22
32
34 private $contentLanguage;
35
36 public function __construct( Language $contentLanguage ) {
37 $this->contentLanguage = $contentLanguage;
38 }
39
40 public function getSortKey( $string ) {
41 return $string;
42 }
43
44 public function getFirstLetter( $string ) {
45 // Copied from UppercaseCollation.
46 // I'm kind of unclear on when this could happen...
47 if ( $string[0] == "\0" ) {
48 $string = substr( $string, 1 );
49 }
50 return $this->contentLanguage->firstChar( $string );
51 }
52}
Collation class that's essentially a no-op.
getFirstLetter( $string)
Given a string, return the logical "first letter" to be used for grouping on category pages and so on...
getSortKey( $string)
Given a string, convert it to a (hopefully short) key that can be used for efficient sorting.
__construct(Language $contentLanguage)
Base class for language-specific code.
Definition Language.php:82