mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-25 00:05:29 +00:00
9fd265d54b
...because that would be crazy. Also fix return documentation. Change-Id: I38c06767f4e53bafff19b4f0819158939ef264c0
38 lines
683 B
PHP
38 lines
683 B
PHP
<?php
|
|
|
|
/**
|
|
* Cache class that maps article id to Title object
|
|
*/
|
|
class EchoTitleLocalCache extends EchoLocalCache {
|
|
|
|
/**
|
|
* @var EchoTitleLocalCache
|
|
*/
|
|
private static $instance;
|
|
|
|
/**
|
|
* Create a TitleLocalCache object
|
|
* @return EchoTitleLocalCache
|
|
*/
|
|
public static function create() {
|
|
if ( !self::$instance ) {
|
|
self::$instance = new EchoTitleLocalCache();
|
|
}
|
|
return self::$instance;
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
protected function resolve() {
|
|
if ( $this->lookups ) {
|
|
$titles = Title::newFromIDs( $this->lookups );
|
|
foreach ( $titles as $title ) {
|
|
$this->targets->set( $title->getArticleId(), $title );
|
|
}
|
|
$this->lookups = array();
|
|
}
|
|
}
|
|
|
|
}
|