mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
f402ecd31f
PHP doesn't care much about the name (in terms of case sensitivity) but I think we should make sure the names of the method should be as they're in their definition. Change-Id: I6e38d8be64efaec4200471f2d3007275d7ddecec
37 lines
606 B
PHP
37 lines
606 B
PHP
<?php
|
|
|
|
/**
|
|
* Cache class that maps article id to Title object
|
|
*/
|
|
class EchoTitleLocalCache extends EchoLocalCache {
|
|
|
|
/**
|
|
* @var EchoTitleLocalCache
|
|
*/
|
|
private static $instance;
|
|
|
|
/**
|
|
* @return EchoTitleLocalCache
|
|
*/
|
|
public static function create() {
|
|
if ( !self::$instance ) {
|
|
self::$instance = new EchoTitleLocalCache();
|
|
}
|
|
|
|
return self::$instance;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
protected function resolve( array $lookups ) {
|
|
if ( $lookups ) {
|
|
$titles = Title::newFromIDs( $lookups );
|
|
foreach ( $titles as $title ) {
|
|
yield $title->getArticleID() => $title;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|