Page MenuHomeWickedGov Phorge

TitleLocalCache.php
No OneTemporary

Size
992 B
Referenced Files
None
Subscribers
None

TitleLocalCache.php

<?php
namespace MediaWiki\Extension\Notifications\Cache;
use MediaWiki\Page\PageRecord;
use MediaWiki\Page\PageStore;
use MediaWiki\Title\TitleFactory;
/**
* Cache class that maps article id to Title object.
* @fixme There should be no need for this class. Core's PageStore should be responsible for caching, if it's
* deemed necessary. See also T344124.
*/
class TitleLocalCache extends LocalCache {
public function __construct(
private readonly PageStore $pageStore,
private readonly TitleFactory $titleFactory,
) {
parent::__construct();
}
/**
* @inheritDoc
*/
protected function resolve( array $lookups ) {
if ( $lookups ) {
$titles = $this->pageStore
->newSelectQueryBuilder()
->wherePageIds( $lookups )
->caller( __METHOD__ )
->fetchPageRecords();
/** @var PageRecord $title */
foreach ( $titles as $title ) {
$title = $this->titleFactory->castFromPageIdentity( $title );
yield $title->getArticleID() => $title;
}
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Oct 4 2026, 18:46 (6 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
80/8e/c13a23dfc2cbd89e6f12c178cf48
Default Alt Text
TitleLocalCache.php (992 B)

Event Timeline