MediaWiki  master
IdentityCollation.php
Go to the documentation of this file.
1 <?php
30 
32  private $contentLanguage;
33 
37  public function __construct( Language $contentLanguage ) {
38  $this->contentLanguage = $contentLanguage;
39  }
40 
41  public function getSortKey( $string ) {
42  return $string;
43  }
44 
45  public function getFirstLetter( $string ) {
46  // Copied from UppercaseCollation.
47  // I'm kind of unclear on when this could happen...
48  if ( $string[0] == "\0" ) {
49  $string = substr( $string, 1 );
50  }
51  return $this->contentLanguage->firstChar( $string );
52  }
53 }
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:56