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