cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); } private function getLatinize($string){ return $this->cache->getWithSetCallback( $this->cache->makeKey('latinizeConvert', $string), $this->cache::TTL_MINUTE * 10, function() use($string){ $convertor = Utils::getConvertor(); $latinize = $convertor->parse($string); $slug = Utils::wordListToUrl($latinize); return $slug; } ); } public function getSortKey($string){ $slug = Utils::getSlugByTitle($string); if($slug){ return ucfirst($slug); } else { return $this->getLatinize($string); } } public function getFirstLetter($string){ $slug = Utils::getSlugByTitle($string); if($slug){ return strtoupper($slug[0]); } else { return strtoupper(mb_substr($this->getLatinize($string), 0, 1, 'UTF-8')); } } }