MediaWiki REL1_37
Collation.php
Go to the documentation of this file.
1<?php
24
30abstract class Collation {
31 private static $instance;
32
38 public static function singleton() {
39 if ( !self::$instance ) {
41 self::$instance = self::factory( $wgCategoryCollation );
42 }
43 return self::$instance;
44 }
45
53 public static function factory( $collationName ) {
54 return MediaWikiServices::getInstance()->getCollationFactory()->makeCollation( $collationName );
55 }
56
70 abstract public function getSortKey( $string );
71
97 abstract public function getFirstLetter( $string );
98
99}
$wgCategoryCollation
Specify how category names should be sorted, when listed on a category page.
static singleton()
Definition Collation.php:38
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...
static $instance
Definition Collation.php:31
static factory( $collationName)
Definition Collation.php:53
MediaWikiServices is the service locator for the application scope of MediaWiki.