MediaWiki  master
Collation.php
Go to the documentation of this file.
1 <?php
24 
30 abstract class Collation {
31  private static $instance;
32 
38  public static function singleton() {
39  wfDeprecated( __METHOD__, '1.37' );
40  if ( !self::$instance ) {
41  global $wgCategoryCollation;
42  self::$instance = self::factory( $wgCategoryCollation );
43  }
44  return self::$instance;
45  }
46 
54  public static function factory( $collationName ) {
55  wfDeprecated( __METHOD__, '1.37' );
56  return MediaWikiServices::getInstance()->getCollationFactory()->makeCollation( $collationName );
57  }
58 
72  abstract public function getSortKey( $string );
73 
99  abstract public function getFirstLetter( $string );
100 
101 }
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:200
Collation\getSortKey
getSortKey( $string)
Given a string, convert it to a (hopefully short) key that can be used for efficient sorting.
Collation\getFirstLetter
getFirstLetter( $string)
Given a string, return the logical "first letter" to be used for grouping on category pages and so on...
Collation
Definition: Collation.php:30
Collation\singleton
static singleton()
Definition: Collation.php:38
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
Definition: GlobalFunctions.php:989
$wgCategoryCollation
$wgCategoryCollation
Specify how category names should be sorted, when listed on a category page.
Definition: DefaultSettings.php:8887
Collation\$instance
static $instance
Definition: Collation.php:31
Collation\factory
static factory( $collationName)
Definition: Collation.php:54