MediaWiki master
Collation.php
Go to the documentation of this file.
1<?php
9namespace MediaWiki\Collation;
10
16abstract class Collation {
17
31 abstract public function getSortKey( $string );
32
39 public function getSortKeys( $strings ) {
40 $ret = [];
41 foreach ( $strings as $key => $s ) {
42 $ret[$key] = $this->getSortKey( $s );
43 }
44 return $ret;
45 }
46
72 abstract public function getFirstLetter( $string );
73
74}
75
77class_alias( Collation::class, 'Collation' );
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.
getSortKeys( $strings)
Get multiple sort keys.
Definition Collation.php:39